ApiException.response constructor
ApiException.response(
- int statusCode,
- String message, {
- ApiErrorPayload? errors,
- RequestBuilder? builder,
Implementation
factory ApiException.response(int statusCode, String message,
{ApiErrorPayload? errors, RequestBuilder? builder}) {
if (statusCode == 400) {
assert(errors == null);
return BadRequestException.parsed(message, builder: builder);
} else {
return ApiResponseException._(
statusCode,
message: message,
builder: builder,
payload: errors,
);
}
}