File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ //! This module implements several error types and traits. The suggested usage in returned results
2
+ //! is as follows:
3
+ //!
4
+ //! * The concrete `util::concrete::Error` type (re-exported as `util::Error`) is great for code
5
+ //! that is not part of the request/response lifecycle. It avoids pulling in the unnecessary
6
+ //! infrastructure to convert errors into a user facing JSON responses (relative to `AppError`).
7
+ //! * `diesel::QueryResult` - There is a lot of code that only deals with query errors. If only
8
+ //! one type of error is possible in a function, using that specific error is preferable to the
9
+ //! more general `util::Error`. This is especially common in model code.
10
+ //! * `util::errors::AppResult` - Some failures should be converted into user facing JSON
11
+ //! responses. This error type is more dynamic and is box allocated. Low-level errors are
12
+ //! typically not converted to user facing errors and most usage is within the models,
13
+ //! controllers, and middleware layers.
14
+
1
15
use std:: any:: { Any , TypeId } ;
2
16
use std:: error:: Error ;
3
17
use std:: fmt;
You can’t perform that action at this time.
0 commit comments