8000 ref(angular): using InjectionToken and optional configuration by iaosee · Pull Request #16778 · getsentry/sentry-javascript · GitHub
[go: up one dir, main page]

Skip to content

ref(angular): using InjectionToken and optional configuration #16778

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

iaosee
Copy link
@iaosee iaosee commented Jul 1, 2025

Using InjectionToken and optional configuration.
This way I can inject the SentryErrorHandler into my custom ErrorHandler.

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

cursor[bot]

This comment was marked as outdated.

@iaosee
Copy link
Author
iaosee commented Jul 1, 2025

In fact, using the spread operator in a literal object will not throw a TypeError .

{ ...null };
{ ...undefined };
var a = null;
var  b = undefined;
var  c = { n: 'cccc', ...a, ...b };

To be on the safe side, I changed it to

{
  logErrors: true,
  ...(options || {}),
}

@iaosee iaosee force-pushed the refactor/inject branch from 41084b3 to 8f63fca Compare July 1, 2025 12:45
@iaosee iaosee changed the title ref(angular) ♻️ using InjectionToken and optional configuration ref(angular): recycle: using InjectionToken and optional configuration Jul 1, 2025
@iaosee iaosee changed the title ref(angular): recycle: using InjectionToken and optional configuration ref(angular): ♻️ using InjectionToken and optional configuration Jul 1, 2025
@iaosee iaosee changed the title ref(angular): ♻️ using InjectionToken and optional configuration ref(angular): using InjectionToken and optional configuration Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0