Use querystring parameter statusCode to test different error codes. Ex:

/error?statusCode=400 to generate a 400 error

/error?statusCode=401 to generate a 401 error

/error?statusCode=500 to generate a 500 error

etc...