I found out this issue locally running on macOS the command npx nx run twenty-server:start
I was trying to sync emails on a setup where the google env var were not defined.
The server crashes, and no other request can be handled by the server until it is manually restarted.
/Users/gl/Documents/twenty/packages/twenty-server/src/engine/core-modules/auth/filters/auth-rest-api-exception.filter.ts:26
throw new UnauthorizedException(exception.message);
^
UnauthorizedException: Google apis auth is not enabled
at AuthRestApiExceptionFilter.catch (/Users/gl/Documents/twenty/packages/twenty-server/src/engine/core-modules/auth/filters/auth-rest-api-exception.filter.ts:26:15)
at ExceptionsHandler.invokeCustomFilters (/Users/gl/Documents/twenty/node_modules/@nestjs/core/exceptions/exceptions-handler.js:33:26)
at ExceptionsHandler.next (/Users/gl/Documents/twenty/node_modules/@nestjs/core/exceptions/exceptions-handler.js:13:18)
at /Users/gl/Documents/twenty/node_modules/@nestjs/core/router/router-proxy.js:13:35
at processTicksAndRejections (node:internal/process/task_queues:95:5)```
Expected behavior
First of all, we should not display the option to sync email with google in this situation where the env var are missing.
Second, when the server handles this 500 error, it should catch it and return a more appropriate message.
Finally, the server should not freeze like that.
Bonus, we could keep track of these errors in sentry
Bug Description
Context
I found out this issue locally running on macOS the command
npx nx run twenty-server:start
I was trying to sync emails on a setup where the google env var were not defined.The bug
The server crashes, and no other request can be handled by the server until it is manually restarted.
Expected behavior
To be discussed further with @charlesBochet