-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop-6.6.x' into epic/CXSPA-2897
- Loading branch information
Showing
16 changed files
with
530 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...etup/ssr/logger/loggers/w3c-trace-context/errors/invalid-traceparent-format-error.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { InvalidTraceparentFormatError } from './invalid-traceparent-format-error'; | ||
|
||
describe('InvalidTraceparentFormatError', () => { | ||
it('should be an instance of InstantiationError', () => { | ||
const error = new InvalidTraceparentFormatError(); | ||
expect(error).toBeInstanceOf(InvalidTraceparentFormatError); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
...ibs/setup/ssr/logger/loggers/w3c-trace-context/errors/invalid-traceparent-format-error.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 SAP Spartacus team <[email protected]> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/** | ||
* Error thrown when the traceparent header has an invalid format. | ||
*/ | ||
export class InvalidTraceparentFormatError extends Error { | ||
constructor() { | ||
super('Traceparent header has invalid format.'); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...etup/ssr/logger/loggers/w3c-trace-context/errors/invalid-traceparent-length-error.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { InvalidTraceparentLengthError } from './invalid-traceparent-length-error'; | ||
|
||
describe('InvalidTraceparentFormatError', () => { | ||
it('should be an instance of InstantiationError', () => { | ||
const error = new InvalidTraceparentLengthError(0); | ||
expect(error).toBeInstanceOf(InvalidTraceparentLengthError); | ||
}); | ||
|
||
it('should have the correct message', () => { | ||
const error = new InvalidTraceparentLengthError(20); | ||
expect(error.message).toBe( | ||
`Traceparent header has invalid length: ${20}. Expected 55 characters.` | ||
); | ||
}); | ||
}); |
17 changes: 17 additions & 0 deletions
17
...ibs/setup/ssr/logger/loggers/w3c-trace-context/errors/invalid-traceparent-length-error.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 SAP Spartacus team <[email protected]> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/** | ||
* Error thrown when the traceparent header has an invalid length. | ||
* @param traceparentLength The length of the traceparent header. | ||
*/ | ||
export class InvalidTraceparentLengthError extends Error { | ||
constructor(traceparentLength: number) { | ||
super( | ||
`Traceparent header has invalid length: ${traceparentLength}. Expected 55 characters.` | ||
); | ||
} | ||
} |
Oops, something went wrong.