oauth21_server/
error.rs

1pub enum ErrorCode {
2    InvalidRequest,
3    UnauthorizedClient,
4    AccessDenied,
5    UnsupportedResponseType,
6    InvalidScope,
7    ServerError,
8    TemporarilyUnavailable,
9}
10
11pub struct OAuthError {
12    pub error: ErrorCode,
13    pub error_description: String,
14    pub state: Option<String>,
15}
16
17impl OAuthError {
18    pub fn new(error: ErrorCode, state: Option<String>) -> OAuthError {
19        OAuthError {
20            error: error,
21            error_description: "".to_string(),
22            state: state,
23        }
24    }
25}
26
27unsafe impl Send for OAuthError {}
28unsafe impl Sync for OAuthError {}