Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw ApplicationError in lifecycles.ts doesn't show error in admin panel #20343

Open
ngaritagoitia opened this issue May 20, 2024 · 0 comments
Assignees
Labels
issue: bug Issue reporting a bug severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve source: core:database Source is core/database package source: core:strapi Source is core/strapi package status: pending reproduction Waiting for free time to reproduce the issue, or more information

Comments

@ngaritagoitia
Copy link

ngaritagoitia commented May 20, 2024

Bug report

Required System information

Environment: development
OS: linux-x64
Strapi Version: 4.24.2
Node/Yarn Version: npm/10.5.0 node/v20.12.2 linux x64 workspaces/false
Edition: Community
Database: mysql2

Describe the bug

throwing ApplicationError from strapi utils doesn't show an error in the admin ui. I get a 400 in the terminal, showing that the error was thrown, but in previous versions of strapi, an error would appear at the top of the admin panel with the custom error message

Steps to reproduce the behavior

add this code to a lifecycles.ts and see how no error is shown in the admin panel:

export default {
  beforeCreate(event) {
    throw new ApplicationError('Test', 400);

  }
}

Expected behavior

An error to be shown at the top of the admin panel with the custom error.

@ngaritagoitia ngaritagoitia changed the title Throw ApplicationError in lifecycles.ts doesn't show error in admin ui Throw ApplicationError in lifecycles.ts doesn't show error in admin panel May 20, 2024
@derrickmehaffy derrickmehaffy added issue: bug Issue reporting a bug severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve source: core:strapi Source is core/strapi package source: core:database Source is core/database package status: pending reproduction Waiting for free time to reproduce the issue, or more information labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve source: core:database Source is core/database package source: core:strapi Source is core/strapi package status: pending reproduction Waiting for free time to reproduce the issue, or more information
Projects
Status: To be reviewed (Open)
Status: To review
Development

No branches or pull requests

2 participants