Skip to content

Commit 8c447e7

Browse files
committed
refactor(material-management): move NotSupported to error.ts
1 parent f37df2f commit 8c447e7

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
export class NotSupported extends Error {
4+
code: string
5+
6+
constructor(message?: string) {
7+
super(message)
8+
Object.setPrototypeOf(this, NotSupported.prototype)
9+
this.code = 'NOT_SUPPORTED'
10+
}
11+
}

modules/material-management/src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export {
7676
readOnlyProperty,
7777
} from './immutable_class'
7878

79-
export { needs, NotSupported } from './needs'
79+
export { needs} from './needs'
8080
export { cloneMaterial } from './clone_cryptographic_material'
8181

8282
export * from './types'
83+
export { NotSupported } from './error'

modules/material-management/src/needs.ts

-9
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,3 @@ export function needs(
2222
}
2323
}
2424

25-
export class NotSupported extends Error {
26-
code: string
27-
28-
constructor(message?: string) {
29-
super(message)
30-
Object.setPrototypeOf(this, NotSupported.prototype)
31-
this.code = 'NOT_SUPPORTED'
32-
}
33-
}

0 commit comments

Comments
 (0)