-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1d7042
commit 84f52c6
Showing
10 changed files
with
70 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ wkb = "0.7.1" | |
bytes = "1.6.0" | ||
geojson = "0.24.1" | ||
serde_json = "1.0.120" | ||
derive_more = "0.99.18" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use derive_more::From; | ||
|
||
pub type Result<T> = core::result::Result<T, Error>; | ||
|
||
#[derive(Debug, From)] | ||
pub enum Error { | ||
// -- utils | ||
FailedInputValidation(String), | ||
Mode(String), | ||
|
||
// -- pg | ||
TableExists(String), | ||
CannotAppend(String), | ||
|
||
// -- file_types | ||
UnsupportedFileExtension(String), | ||
UnsupportedShapeType(String), | ||
ContainsMixedDataTypes(String), | ||
|
||
// -- Externals | ||
#[from] | ||
Io(std::io::Error), | ||
#[from] | ||
Pg(postgres::Error), | ||
#[from] | ||
Shapefile(shapefile::Error), | ||
} | ||
|
||
// region: --- Error Boilerplate | ||
|
||
impl core::fmt::Display for Error { | ||
fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::result::Result<(), core::fmt::Error> { | ||
write!(fmt, "{self:?}") | ||
} | ||
} | ||
|
||
impl std::error::Error for Error {} | ||
|
||
// endregion: --- Error Boilerplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters