Skip to content

Commit 40c8df0

Browse files
committed
vm: remove makeError method
1 parent c0500a4 commit 40c8df0

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

packages/vm/src/errors.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -39,48 +39,6 @@ export type CodedGeneralError<T> = T extends ErrorCode.INVALID_BLOCK_HEADER
3939
export class Logger {
4040
static errors = ErrorCode
4141

42-
// makeError<T>(codedError: CodedGeneralError<T>): Error {
43-
// let { message } = codedError
44-
// const { code } = codedError
45-
// const messageDetails: Array<string> = []
46-
47-
// if (isError(codedError, ErrorCode.INVALID_BLOCK_HEADER)) {
48-
// messageDetails.push('Invalid param' + '=' + codedError.param)
49-
// }
50-
51-
// if (isError(codedError, ErrorCode.UNKNOWN_ERROR)) {
52-
// Object.keys(codedError)
53-
// .filter((key) => key !== 'message' && key !== 'code')
54-
// .forEach((key) => {
55-
// const value = codedError[key]
56-
// try {
57-
// messageDetails.push(key + '=' + JSON.stringify(value))
58-
// } catch {
59-
// messageDetails.push(key + '=' + JSON.stringify(codedError[key].toString()))
60-
// }
61-
// })
62-
// }
63-
64-
// messageDetails.push(`code=${codedError.code}`)
65-
66-
// if (messageDetails.length) {
67-
// message += ' (' + messageDetails.join(', ') + ')'
68-
// }
69-
70-
// const error = new Error(message) as CodedGeneralError<T>
71-
// error.code = code
72-
73-
// // TODO: Find how to add all args
74-
75-
// // Object.keys(codedError)
76-
// // .filter((key) => key !== 'message' && key !== 'code')
77-
// // .forEach((key) => {
78-
// // error[key] = codedError[key]
79-
// // })
80-
81-
// return error
82-
// }
83-
8442
throwError<T extends ErrorCode>(error: CodedGeneralError<T>): never {
8543
if (!error.code) {
8644
error.code = ErrorCode.UNKNOWN_ERROR

0 commit comments

Comments
 (0)