Skip to content

Commit

Permalink
build(deps): bump serialize-error from 3.0.0 to 11.0.1 (#844)
Browse files Browse the repository at this point in the history
* build(deps): bump serialize-error from 3.0.0 to 11.0.1

Bumps [serialize-error](https://github.com/sindresorhus/serialize-error) from 3.0.0 to 11.0.1.
- [Release notes](https://github.com/sindresorhus/serialize-error/releases)
- [Commits](sindresorhus/serialize-error@v3.0.0...v11.0.1)

---
updated-dependencies:
- dependency-name: serialize-error
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kirrg001 <[email protected]>
  • Loading branch information
dependabot[bot] and kirrg001 authored Aug 23, 2023
1 parent 5968372 commit 5fa039c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 19 deletions.
41 changes: 33 additions & 8 deletions packages/collector/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/collector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"@instana/shared-metrics": "2.30.0",
"bunyan": "^1.8.15",
"semver": "7.5.3",
"serialize-error": "^3.0.0"
"serialize-error": "^8.1.0"
},
"optionalDependencies": {
"@instana/autoprofile": "2.30.0"
Expand Down
13 changes: 3 additions & 10 deletions packages/collector/src/uncaught/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @typedef {import('@instana/core/src/util/stackTrace').InstanaExtendedError} InstanaExtendedError
*/

// @ts-ignore @types/serialize-error is deprecated and updating to version 8.1.0 seems to break some stuff on our side
const serializeError = require('serialize-error');

/** @type {import('@instana/core/src/logger').GenericLogger} */
Expand Down Expand Up @@ -40,13 +39,6 @@ for (let i = 0; i < process.execArgv.length; i++) {
}
}

/**
* @typedef {Object} SerializedErrorObject
* @property {string} name
* @property {string} message
* @property {string} stack
*/

/**
* @param {import('../util/normalizeConfig').CollectorConfig} _config
* @param {import('../agentConnection')} _downstreamConnection
Expand Down Expand Up @@ -159,8 +151,9 @@ function createEvent(error, title, severity, isPromiseRejection) {
*/
function errorToMarkdown(error) {
/* eslint-disable max-len */
/** @type {SerializedErrorObject} */
const serializedError = serializeError(error);
/** @type {import('serialize-error').ErrorObject} ErrorObject */
const serializedError = serializeError.serializeError(error);

if (serializedError.name && serializedError.message && typeof serializedError.stack === 'string') {
// prettier-ignore
return `### ${serializedError.name}\n\n#### Message: \n\n${serializedError.message}\n\n#### Stack:\n\n${stackTraceToMarkdown(serializedError.stack)}`;
Expand Down

0 comments on commit 5fa039c

Please sign in to comment.