Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@ndla/error-reporter
Advanced tools
Error reporter for NDLA. Listens to window.onerror and sends client errors to Loggly.
Error reporter for NDLA. Listens to window.onerror and sends client errors to Loggly
N.B. Number of messages is limited to 10 per session (reset by browser refresh).
yarn add @ndla/error-reporter
npm install @ndla/error-reporter
A polyfill for fetch is needed for cross-browser support.
import { ErrorReporter } from '@ndla/error-reporter');
const reduxStore = configureStore();
window.errorReporter = ErrorReporter.getInstance({ logglyApiKey: 'xxx', store: reduxStore, environment: 'test', componentName: 'ndla-frontend' });
ReactDOM.render(
<Provider store={store} locale={locale}>
...
</Provider>,
document.getElementById('app-container')
);
ErrorReporter is a singleton:
// After initial instantiation
import { ErrorReporter } from "@ndla/error-reporter";
ErrorReporter.getInstance().captureMessage("Testing");
ErrorReporter.captureError(error, [additionalInfo])
Processes error and sends error info to Loggly with optional additional info.
try {
// some "dangerous" code
} catch (e) {
errorReporter.captureError(e, { url: "http://example.com" });
}
Parameters:
Name | Type | Description |
---|---|---|
error | Object | Required. Error object to process and send to Loggy. |
additionalInfo | Object | Optional. Additional information you want to send to Loggly. |
ErrorReporter.captureMessage(msg)
Sends a text/message to Loggly with log level info
errorReporter.captureMessage("Testing");
Parameters:
Name | Type | Description |
---|---|---|
msg | String | Required. The message you want to send to Loggly. |
ErrorReporter.refresh()
Reset remaining messages to 10.
errorReporter.refresh();
FAQs
Error reporter for NDLA. Listens to window.onerror and sends client errors to Loggly.
The npm package @ndla/error-reporter receives a total of 103 weekly downloads. As such, @ndla/error-reporter popularity was classified as not popular.
We found that @ndla/error-reporter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.