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

🚀 Feature: allow us to manipulate error response #5168

Open
2 tasks done
simonare opened this issue Feb 7, 2024 · 1 comment
Open
2 tasks done

🚀 Feature: allow us to manipulate error response #5168

simonare opened this issue Feb 7, 2024 · 1 comment
Labels

Comments

@simonare
Copy link

simonare commented Feb 7, 2024

🔖 Feature description

Novu NodeJS library is inherited from EventEmitter but there is no way to listen to events (also http events) or add interceptor(s) to handle errors on http context since "http" is implemented as private.

🎤 Why is this feature needed ?

I need to transpile generated errors into a more understandable context for my application.

✌️ How do you aim to achieve this?

This can be easily achieved by exposing http context or by giving the option to add interceptor(s) at the event of Client instance creation.

🔄️ Additional Information

I am using a workaround at the moment.

(novu as any).http.interceptors.response.use(
    (response: AxiosResponse) => response,
      (error: AxiosError) => {
        return Promise.reject(error?.response?.data);
    },
);

👀 Have you spent some time to check if this feature request has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

Copy link

linear bot commented Feb 7, 2024

NV-3483 🚀 Feature:

@github-actions github-actions bot added the triage label Feb 7, 2024
@simonare simonare changed the title 🚀 Feature: 🚀 Feature: allow us to manipulate error response Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant