You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by "urlyy (via GitHub)" <gi...@apache.org> on 2025/10/08 18:54:41 UTC

[I] [Rust] no need for customize Error [fory]

urlyy opened a new issue, #2725:
URL: https://github.com/apache/fory/issues/2725

   ### Feature Request
   
   No need for a custom error type.
   
   Currently, fory-rust defines an enum in `error.rs` to handle `Ref` errors and other kinds of errors. But now that the implementation of `tracking_ref` in Rust is complete, `RefError` is no longer needed. Furthermore, there’s no need for a custom error type at all — we can just `use anyhow::{Error, bail, ensure}` directly. And `error.rs` can be removed.
   
   The error handling in fory-rust is a bit messy right now, and this needs to be addressed before tackling #2706.
   
   ### Is your feature request related to a problem? Please describe
   
   _No response_
   
   ### Describe the solution you'd like
   
   _No response_
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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: commits-unsubscribe@fory.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [I] [Rust] no need to customize Error [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #2725:
URL: https://github.com/apache/fory/issues/2725#issuecomment-3384883674

    @jiacai2050 do you have any suggestions?


-- 
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: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [I] [Rust] no need to customize Error [fory]

Posted by "jiacai2050 (via GitHub)" <gi...@apache.org>.
jiacai2050 commented on issue #2725:
URL: https://github.com/apache/fory/issues/2725#issuecomment-3387960373

   > I perfer using customized Error type. Use standard error type lost semantic failures, and we can't extend it anymore. Almost all serialization framework use customized Error type
   
   This makes sense to me as well; a customized `Error` type allows developers to choose what kind of error they want to handle and what kind of error they want to ignore.


-- 
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: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [I] [Rust] no need to customize Error [fory]

Posted by "urlyy (via GitHub)" <gi...@apache.org>.
urlyy closed issue #2725: [Rust] no need to customize Error
URL: https://github.com/apache/fory/issues/2725


-- 
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: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [I] [Rust] no need to customize Error [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #2725:
URL: https://github.com/apache/fory/issues/2725#issuecomment-3385814015

   Some error type came into me is:
   ```rust
   #[derive(Error, Debug)]
   #[non_exhaustive]
   pub enum Error {
       #[error("Fory on Rust not support Ref type")]
       Ref,
       DynDepthExceed,
       NullPointer,
       TypeMismatch,
       BufferOutOfBand,
       InvalidDataRead,
       UnsupprtedType,
       SizeLimitExceeded,
       UnknownReference,
       TypeNotRegistered,
       #[error(transparent)]
       Other(#[from] anyhow::Error),
   }
   ```


-- 
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: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [I] [Rust] no need to customize Error [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #2725:
URL: https://github.com/apache/fory/issues/2725#issuecomment-3385794579

   I perfer using customized Error type. Use standard error type lost semantic failures, and we can't extend it anymore. Almost all serialization framework use  customized 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: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [I] [Rust] no need to customize Error [fory]

Posted by "urlyy (via GitHub)" <gi...@apache.org>.
urlyy commented on issue #2725:
URL: https://github.com/apache/fory/issues/2725#issuecomment-3388378359

   Okay, I’ll try adding corresponding enums for various error scenarios in #2706.


-- 
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: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org