class APIError(Exception):
    pass


class ImproperlyConfigured(Exception):
    pass


class ValidationError(Exception):
    pass

class APIError(Exception):
    def __init__(self, messages):
        self.messages = messages

    def __str__(self):
        import json
        return json.dumps(self.messages, indent=2)


class ImproperlyConfigured(Exception):
    pass


class ValidationError(Exception):
    pass

Return formatted messages in APIError
Return formatted messages in APIError

  class APIError(Exception):
-     pass
+     def __init__(self, messages):
+         self.messages = messages
+ 
+     def __str__(self):
+         import json
+         return json.dumps(self.messages, indent=2)
  
  
  class ImproperlyConfigured(Exception):
      pass
  
  
  class ValidationError(Exception):
      pass
  
Return formatted messages in APIError
## Code Before:
class APIError(Exception):
    pass


class ImproperlyConfigured(Exception):
    pass


class ValidationError(Exception):
    pass

## Instruction:
Return formatted messages in APIError
## Code After:
class APIError(Exception):
    def __init__(self, messages):
        self.messages = messages

    def __str__(self):
        import json
        return json.dumps(self.messages, indent=2)


class ImproperlyConfigured(Exception):
    pass


class ValidationError(Exception):
    pass
