responseError function
Implementation
void responseError(int statusCode) {
switch (statusCode) {
case 400:
throw StokedError('Malformed request');
case 404:
throw StokedError('Incorrect URL');
case 401:
throw StokedError('Unauthorized request');
case 500:
throw StokedError('Internal server error');
case 502:
throw StokedError('Bad gateway');
default:
break;
}
}