@@ -5,21 +5,6 @@ use thiserror::Error;
55#[ derive( Error , Debug ) ]
66#[ non_exhaustive]
77pub enum Error {
8- /// [arrow_schema::ArrowError]
9- #[ error( transparent) ]
10- #[ cfg( feature = "geoarrow" ) ]
11- Arrow ( #[ from] arrow_schema:: ArrowError ) ,
12-
13- /// The schema of two sets of items don't match.
14- #[ cfg( feature = "geoarrow" ) ]
15- #[ error( "Arrow schema mismatch" ) ]
16- ArrowSchemaMismatch ,
17-
18- /// The arrow table is empty
19- #[ cfg( feature = "geoarrow" ) ]
20- #[ error( "Empty arrow table" ) ]
21- EmptyArrowTable ,
22-
238 /// [chrono::ParseError]
249 #[ error( transparent) ]
2510 ChronoParse ( #[ from] chrono:: ParseError ) ,
@@ -28,19 +13,10 @@ pub enum Error {
2813 #[ error( "{0} is not enabled" ) ]
2914 FeatureNotEnabled ( & ' static str ) ,
3015
31- /// [geoarrow_schema::error::GeoArrowError]
32- #[ error( transparent) ]
33- #[ cfg( feature = "geoarrow" ) ]
34- GeoArrow ( #[ from] geoarrow_schema:: error:: GeoArrowError ) ,
35-
3616 /// [geojson::Error]
3717 #[ error( transparent) ]
3818 Geojson ( #[ from] Box < geojson:: Error > ) ,
3919
40- /// [std::io::Error]
41- #[ error( transparent) ]
42- Io ( #[ from] std:: io:: Error ) ,
43-
4420 /// Returned when a STAC object has the wrong type field.
4521 #[ error( "incorrect type: expected={expected}, actual={actual}" ) ]
4622 IncorrectType {
@@ -64,32 +40,26 @@ pub enum Error {
6440 #[ error( "invalid datetime: {0}" ) ]
6541 InvalidDatetime ( String ) ,
6642
43+ /// [std::io::Error]
44+ #[ error( transparent) ]
45+ Io ( #[ from] std:: io:: Error ) ,
46+
6747 /// Returned when there is not a required field on a STAC object
6848 #[ error( "no \" {0}\" field in the JSON object" ) ]
6949 MissingField ( & ' static str ) ,
7050
71- /// No geoparquet metadata in a stac-geoparquet file.
72- #[ error( "no geoparquet metadata" ) ]
73- #[ cfg( feature = "geoparquet" ) ]
74- MissingGeoparquetMetadata ,
51+ /// There is not an href, when an href is required.
52+ #[ error( "no href" ) ]
53+ NoHref ,
7554
7655 /// There are no items, when items are required.
7756 #[ error( "no items" ) ]
7857 NoItems ,
7958
80- /// There is not an href, when an href is required.
81- #[ error( "no href" ) ]
82- NoHref ,
83-
8459 /// This is not a JSON object.
8560 #[ error( "json value is not an object" ) ]
8661 NotAnObject ( serde_json:: Value ) ,
8762
88- /// [parquet::errors::ParquetError]
89- #[ error( transparent) ]
90- #[ cfg( feature = "geoparquet" ) ]
91- Parquet ( #[ from] parquet:: errors:: ParquetError ) ,
92-
9363 /// [serde_json::Error]
9464 #[ error( transparent) ]
9565 SerdeJson ( #[ from] serde_json:: Error ) ,
@@ -114,8 +84,43 @@ pub enum Error {
11484 #[ error( transparent) ]
11585 UrlParse ( #[ from] url:: ParseError ) ,
11686
87+ /// [arrow_schema::ArrowError]
88+ #[ error( transparent) ]
89+ #[ cfg( feature = "geoarrow" ) ]
90+ Arrow ( #[ from] arrow_schema:: ArrowError ) ,
91+
92+ /// The schema of two sets of items don't match.
93+ #[ cfg( feature = "geoarrow" ) ]
94+ #[ error( "Arrow schema mismatch" ) ]
95+ ArrowSchemaMismatch ,
96+
97+ /// The arrow table is empty
98+ #[ cfg( feature = "geoarrow" ) ]
99+ #[ error( "Empty arrow table" ) ]
100+ EmptyArrowTable ,
101+
102+ /// [geoarrow_schema::error::GeoArrowError]
103+ #[ error( transparent) ]
104+ #[ cfg( feature = "geoarrow" ) ]
105+ GeoArrow ( #[ from] geoarrow_schema:: error:: GeoArrowError ) ,
106+
117107 /// [wkb::error::WkbError]
118108 #[ error( transparent) ]
119109 #[ cfg( feature = "geoarrow" ) ]
120110 Wkb ( #[ from] wkb:: error:: WkbError ) ,
111+
112+ /// The geoparquet writer has been closed.
113+ #[ error( "The geoparquet writer has already been closed" ) ]
114+ #[ cfg( feature = "geoparquet" ) ]
115+ ClosedGeoparquetWriter ,
116+
117+ /// No geoparquet metadata in a stac-geoparquet file.
118+ #[ error( "no geoparquet metadata" ) ]
119+ #[ cfg( feature = "geoparquet" ) ]
120+ MissingGeoparquetMetadata ,
121+
122+ /// [parquet::errors::ParquetError]
123+ #[ error( transparent) ]
124+ #[ cfg( feature = "geoparquet" ) ]
125+ Parquet ( #[ from] parquet:: errors:: ParquetError ) ,
121126}
0 commit comments