Leosac  0.8.0
Open Source Access Control
APIStatusCode.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2016 Leosac
3 
4  This file is part of Leosac.
5 
6  Leosac is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Affero General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Leosac is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 namespace Leosac
23 {
31 enum class APIStatusCode
32 {
36  SUCCESS = 0x00,
37 
41  GENERAL_FAILURE = 0x01,
42 
47  PERMISSION_DENIED = 0x02,
48 
53  RATE_LIMITED = 0x03,
54 
58  MALFORMED = 0x04,
59 
63  INVALID_CALL = 0x05,
64 
70  TIMEOUT = 0x06,
71 
77  SESSION_ABORTED = 0x07,
78 
82  ENTITY_NOT_FOUND = 0x08,
83 
87  DATABASE_ERROR = 0x09,
88 
93  UNKNOWN = 0x0A,
94 
100  MODEL_EXCEPTION = 0x0B,
101 
106  INVALID_ARGUMENT = 0x0C
107 };
108 }
Leosac::APIStatusCode::MODEL_EXCEPTION
@ MODEL_EXCEPTION
Some internal API rules has failed.
Leosac::APIStatusCode::SUCCESS
@ SUCCESS
Indicate that the request's processing went well.
Leosac::APIStatusCode::INVALID_ARGUMENT
@ INVALID_ARGUMENT
One of the argument of the call had a invalid value / type.
Leosac::APIStatusCode::ENTITY_NOT_FOUND
@ ENTITY_NOT_FOUND
The requested entity cannot be found.
Leosac::APIStatusCode::SESSION_ABORTED
@ SESSION_ABORTED
The session has been aborted.
Leosac::APIStatusCode::TIMEOUT
@ TIMEOUT
The request took too long to process.
Leosac::APIStatusCode::GENERAL_FAILURE
@ GENERAL_FAILURE
A failure for an unknown reason.
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::APIStatusCode::PERMISSION_DENIED
@ PERMISSION_DENIED
The websocket connection is not allowed to make the requested API call.
Leosac::APIStatusCode::MALFORMED
@ MALFORMED
The source packet was malformed.
Leosac::APIStatusCode::UNKNOWN
@ UNKNOWN
Unknown status.
Leosac::APIStatusCode::INVALID_CALL
@ INVALID_CALL
The API method (ie, message's type) does not exist.
Leosac::APIStatusCode
APIStatusCode
Those are the Leosac API status code.
Definition: APIStatusCode.hpp:31
Leosac::APIStatusCode::DATABASE_ERROR
@ DATABASE_ERROR
An internal database operation threw an exception.
Leosac::APIStatusCode::RATE_LIMITED
@ RATE_LIMITED
The websocket connection is rate limited, and it already sent too many packets.