chaokunyang commented on code in PR #2765:
URL: https://github.com/apache/fory/pull/2765#discussion_r2428536489
##########
rust/fory-core/src/error.rs:
##########
@@ -15,38 +15,102 @@
// specific language governing permissions and limitations
// under the License.
+use std::borrow::Cow;
+
use thiserror::Error;
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum Error {
- #[error("Fory on Rust not support Ref type")]
- Ref,
+ // not use this, just as a example.
+ // You can create new error enums for specific cases in the future.
+ #[error("Type mismatch: type_a = {0}, type_b = {1}")]
+ TypeMismatch(u32, u32),
+ // don't use this directly, use Error::from() instead
#[error(transparent)]
- Other(#[from] anyhow::Error),
+ Wrapped(#[from] anyhow::Error),
Review Comment:
The deserialization can have BufferOutOfBound, maybe deserve an error type
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]