def METHOD_NAME(error):
  if error.code == 404:
    return NotFound()
  elif error.code == 406:
    return NotAcceptable()
  elif 500 <= error.code < 600:
    return ServerError()
  else:
    return UnexpectedResponse( str( error ) )