
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@gavant/ember-error-logger
Advanced tools
Ember addon for handling and logging uncaught application errors
ember-error-logger enables the handling and logging of uncaught errors. Handled error can be logged to a backend endpoint or passed through custom logic. By default, the addon includes consumers for local and remote logging of errors.
Errors thrown are caught by listener bound to error producers (window, Ember ...).
Errors handled by listeners are passed to various consumers which could log the error, render error page or
perform additional logic. Consumers and listeners are both fully extendable and customizable.
ember install @gavant/ember-error-logger
then throw error somewhere in application and watch the console.
Both listeners
and consumers
are enabled by defining an object with the property keys corresponding to the name/path of the object. To enable it with its default configuration, just set the property value to true
, otherwise you may set it to a child object containing any valid configuration values.
Define an Ember Object in app/error-listeners to use as listeners.
Definition could be based on environment.
Object must extend error-listeners/base-listener
object.
// config/environment.js
if (environment === 'development' || environment === 'production') {
ENV['ember-error-logger'].listeners = {
'window-listener': true,
'ember-listener': {
ember: true,
transitions: true,
actions: true,
rsvp: true
}
};
}
Note: the above configuration is the default for development
and production
environments.
Define services to use as listeners.
Definition could be based on environment.
Service must extend error-consumers/base-consumer
object.
Consumers are executed in order.
// config/environment.js
if (environment === 'development') {
ENV['ember-error-logger'].consumers = {
'console-consumer': true
};
}
if (environment === 'production') {
ENV['ember-error-logger'].consumers = [
'api-consumer': {
endpoint: 'http://your-api.com/error-event'
}
];
}
Note: by default, only the console-consumer
is enabled in development
.
The api-consumer allows errors to be easily sent to a backend along with some additional client information (user agent, resolution/viewport, current URL). In addition to adding the consumer to the consumers
config object, you must define an endpoint
in its child object which this information will be POST'ed to (see example consumers config above).
IMPORTANT The api-consumer uses ember-ajax to make the AJAX request. If you have extended the service with a custom host, you may need to adjust the ember-error-logger.consumers.api-consumer.endpoint
value accordingly.
IMPORTANT
If you need to modify the payload that is sent to the endpoint, you can override the api consumer and change the stringifyData
method.
Some API request errors may not be handled/logged by default (for example, if they are not triggered by a route transition). To log these errors, use the ember-error-logger/mixins/log-api-errors
mixin in your ember-data adapter and/or ajax service. Additionally, this mixin will also stringify response payloads so that they can read in the error message (instead of just displaying as [object Object]
).
Addon plays nicely with Exceptional Exceptions addon: https://github.com/janmisek/ember-exex
Forked from and inspired by https://github.com/janmisek/ember-error-handler :-)
FAQs
Ember addon for handling and logging uncaught application errors
We found that @gavant/ember-error-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.