protected function throwExceptions()
    {
        $status = $this->getStatusCode();

        switch ($status) {
            case 400:
                throw new ValidationException($this);
                break;
            case 401:
                throw new UnauthorizedException($this);
                break;
            case 404:
                throw new ResourceNotFoundException($this);
                break;
            default:
                //
                break;
        }

        if ($status >= 400 && $status < 500) {
            throw new ClientRequestException($this, 'Whoops looks like something went wrong');
        } elseif ($status >= 500) {
            throw new ServerRequestException($this);
        }
    }
protected function throwExceptions()
    {
        $status = $this->getStatusCode();

        switch ($status) {
            case 400:
                throw new ValidationException($this);
                break;
            case 401:
                throw new UnauthorizedException($this);
                break;
            case 404:
                throw new ResourceNotFoundException($this);
                break;
            default:
                //
                break;
        }

        if ($status >= 400 && $status < 500) {
            throw new ClientRequestException($this, 'Whoops looks like something went wrong');
        } elseif ($status >= 500) {
            throw new ServerRequestException($this);
        }
    }
protected function throwExceptions ( ) { $ status = $ this -> getStatusCode ( ) ; switch ( $ status ) { case 400 : throw new ValidationException ( $ this ) ; break ; case 401 : throw new UnauthorizedException ( $ this ) ; break ; case 404 : throw new ResourceNotFoundException ( $ this ) ; break ; default : // break ; } if ( $ status >= 400 && $ status < 500 ) { throw new ClientRequestException ( $ this , 'Whoops looks like something went wrong' ) ; } elseif ( $ status >= 500 ) { throw new ServerRequestException ( $ this ) ; } }
Throw request exceptions

@throws ValidationException
@throws UnauthorizedException
@throws ResourceNotFoundException
@throws ClientRequestException
@throws ServerRequestException
@return void
Throw request exceptions