Skip to content

InvalidMediaTypeValue is not hashable #142

Closed
@dz0ny

Description

@dz0ny

InvalidMediaTypeValue cannot be inspected for uniqueness (missing hash method), subsequently Raven(sentry-sdk), Stackdriver capture error reports.

    File "/app/.heroku/python/lib/python3.7/site-packages/pyramid_openapi3/__init__.py", line 84, in wrapper_view 
      result.raise_for_errors() 
    File "/app/.heroku/python/lib/python3.7/site-packages/openapi_core/validation/models.py", line 11, in raise_for_errors 
      raise error 
    File "/app/.heroku/python/lib/python3.7/site-packages/openapi_core/validation/response/validators.py", line 64, in _get_data 
      data = media_type.unmarshal(raw_data, self.custom_formatters) 
    File "/app/.heroku/python/lib/python3.7/site-packages/openapi_core/schema/media_types/models.py", line 47, in unmarshal 
      raise InvalidMediaTypeValue(exc) 
  openapi_core.schema.media_types.exceptions.InvalidMediaTypeValue: Mimetype invalid: Invalid schema property currency: Value RON not in enum choices: ['EUR', 'GBP', 'USD'] 
  During handling of the above exception, another exception occurred: 
  Traceback (most recent call last): 
    File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 135, in handle 
      self.handle_request(listener, req, client, addr) 
    File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 176, in handle_request 
      respiter = self.wsgi(environ, resp.start_response) 
    File "/app/.heroku/python/lib/python3.7/site-packages/raven/middleware.py", line 100, in __call__ 
      iterable = self.application(environ, start_response) 
    File "/app/.heroku/python/lib/python3.7/contextlib.py", line 130, in __exit__ 
      self.gen.throw(type, value, traceback) 
    File "/app/.heroku/python/lib/python3.7/site-packages/raven/middleware.py", line 27, in common_exception_handling 
      client.handle_exception(environ) 
    File "/app/.heroku/python/lib/python3.7/site-packages/raven/middleware.py", line 115, in handle_exception 
      return self.client.captureException() 
    File "/app/.heroku/python/lib/python3.7/site-packages/raven/base.py", line 826, in captureException 
      'raven.events.Exception', exc_info=exc_info, **kwargs) 
    File "/app/.heroku/python/lib/python3.7/site-packages/raven/base.py", line 646, in capture 
      **kwargs) 
    File "/app/.heroku/python/lib/python3.7/site-packages/raven/base.py", line 394, in build_msg 
      result = handler.capture(**kwargs) 
    File "/app/.heroku/python/lib/python3.7/site-packages/raven/events.py", line 120, in capture 
      for exc_info in _chained_exceptions(exc_info): 
    File "/app/.heroku/python/lib/python3.7/site-packages/raven/events.py", line 52, in _chained_exceptions 
      context.add(exc) 
  TypeError: unhashable type: 'InvalidMediaTypeValue' 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions