handle static method
Implementation
static Exception handle(int? statusCode) {
switch (statusCode) {
case 401:
return UnauthorizedException();
case 500:
return ServerErrorException();
default:
return SomethingWentWrongException();
}
}