Factory method to create an ApiError instance.
An instance of ApiError representing the API error.
The HTTP status code of the error.
The error message.