FromParts<Protocol>::Rejection must implement std::fmt::Display for user-defined parameters passed to operation handlers
              
              #3749
            
            
                  
                    
                      drganjoo
                    
                  
                
                  announced in
                Change Log
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
An operation handler can accept user-defined data types as long as they implement
FromParts<Protocol>. The trait has an associated typeRejection. Whatever data type is set forRejectionmust now implement (at least)std::fmt::Display. Additionally, it is recommended to implementstd::error::Errorfor that type.This requirement is necessary to help us write error log entries when the parameter that the operation handler expects fails to be
constructed from the request parts.
As an example of implementing
std::error::Error, you can refer to theRuntimeErrorenum.Beta Was this translation helpful? Give feedback.
All reactions