Skip to content

4.15.0: Application Error is returning Internal Server Error instead of actual error. #19686

@gregg-cbs

Description

@gregg-cbs

Bug report

Required System information

  • Node.js version: 18.16.0
  • NPM version: 9.5.1
  • Strapi version: 4.15.0
  • Operating system: Windows and Mac
  • Is your project Javascript or Typescript: TS

Describe the bug

When throwing throw new ApplicationError in a controller or service strapi is returning "Internal Server Error" instead of the application error. This was not always the case although we have once seen this before due to a node version.

Now all of a sudden it is happening again on two different devices and we are not sure if some dependency has updated.

Steps to reproduce the behavior

  1. Controller throws 'throw new ApplicationError("You do not have permissions to do this")
  2. Rest api querying said controller is receiving "Internal Server Error" instead of the application error

Expected behavior

This behaviour has been before but we got rid of it by changing to node 18. Now it is happening again since we had an issue with strapi auto bumping to the next version and we downgraded back to 4.15.0.

Screenshots

Query:
image

Controller:
image

Metadata

Metadata

Assignees

Labels

issue: bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundsource: core:coreSource is core/corestatus: confirmedConfirmed by a Strapi Team member or multiple community membersstatus: duplicateIs a duplicate of another issueversion: 4Issue is present in Strapi v4

Type

No type

Projects

Status

Fixed/Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions