0
votes

I am using Api Platform with graphql.

Symfony Flex, Symfony 4.4, api-platform/core v2.5.6.

When I throw exceptions in prod mode the only thing I see is the general 'Internal server error' message instead of my own exceptions messages.

{
  "errors": [
    {
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      }
    }  
}

How is it possible when I throw my own exceptions to see the messages?

throw new \Exception('Show this exception message');

Thanks

1
what version of Symfony? - Arleigh Hix
Thx for your reaction. Symfony version 4.4. - Joost

1 Answers

0
votes

You can use a custom error normalizer to add the message you want when a supported exception is thrown.