Enum roboat::RoboatError
source · pub enum RoboatError {
TooManyRequests,
InternalServerError,
BadRequest,
InvalidRoblosecurity,
UserDoesNotOwnAsset,
UnknownRobloxErrorCode {
code: u16,
message: String,
},
RoblosecurityNotSet,
UnidentifiedStatusCode(u16),
MalformedResponse,
InvalidXcsrf(String),
XcsrfNotReturned,
ReqwestError(Error),
}Expand description
The universal error used in this crate.
Variants§
TooManyRequests
Used when an endpoint returns status code 429.
InternalServerError
Used when an endpoint returns status code 500.
BadRequest
Used when an endpoint returns status code 400. This is used when the server cannot process the data sent, whether it be because it is in the wrong format or it contains too much data.
InvalidRoblosecurity
Returned when the user does not have a valid roblosecurity, or does not have authorization to access the endpoint.
This is also used as the backup error when an endpoint returns a 401 status code but the error cannot be parsed from the response.
Error code 0.
UserDoesNotOwnAsset
Returned when the endpoint returns a 401 status code, with Roblox saying that the user does not own the asset (e.g., in the case of selling an item).
Roblox error code 9.
UnknownRobloxErrorCode
Fields
Returned when the endpoint returns a 401 status code, but the error response contains an unknown Roblox error code.
RoblosecurityNotSet
Used when no roblosecurity is set, on an endpoint that requires it.
UnidentifiedStatusCode(u16)
Used for any status codes that do not fit any enum variants of this error. If you encounter this enum variant, please submit an issue so a variant can be made or the crate can be fixed.
MalformedResponse
Used when the response from an API endpoint is malformed.
InvalidXcsrf(String)
Used when an endpoint rejects a request due to an invalid xcsrf. Mostly used internally invalid xcsrf is returned due to the fact that rust does not allow async recursion without making a type signature extremely messy.
XcsrfNotReturned
Used when an endpoint returns a 403 status code, but the response does not contain a new xcsrf.
ReqwestError(Error)
Used for any reqwest error that occurs.