Skip to content

Commit 4248536

Browse files
committed
Return error on failure
1 parent e74ccfb commit 4248536

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/proj.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ pub enum ProjError {
125125
DownloadError(String, String, u8),
126126
#[error("The current definition could not be retrieved")]
127127
Definition,
128+
#[error("The definition could not be represented in the requested JSON format")]
129+
ExportToJson,
128130
}
129131

130132
#[cfg(feature = "network")]
@@ -1107,8 +1109,7 @@ impl Proj {
11071109
unsafe {
11081110
let out_ptr = proj_as_projjson(self.ctx, self.c_proj, opts_ptrs.as_ptr());
11091111
if out_ptr.is_null() {
1110-
// Not sure the best way to retrieve and return the error
1111-
todo!()
1112+
Err(ProjError::ExportToJson)
11121113
} else {
11131114
Ok(_string(out_ptr)?)
11141115
}

0 commit comments

Comments
 (0)