@vechain/sdk-logging
Advanced tools
Comparing version 1.0.0-beta.24 to 1.0.0-beta.25
@@ -1,2 +0,2 @@ | ||
import { ErrorCode, DataType } from '@vechain/sdk-errors'; | ||
import { ErrorCode, DataType, VechainSDKError } from '@vechain/sdk-errors'; | ||
@@ -43,8 +43,3 @@ /** | ||
* | ||
* VeChainSDKLogger('error').log({ | ||
* errorCode: DATA.INVALID_DATA_TYPE, | ||
* errorMessage: 'Message we want to use for invalid data type ...', | ||
* errorData: input, | ||
* innerError: new Error('This is the inner error') | ||
* }); | ||
* VeChainSDKLogger('error').log(new JSONRPCInternalError('test-method', -32603, `Error on request`, { some: 'data' })); | ||
* | ||
@@ -56,5 +51,3 @@ */ | ||
? { | ||
log: <TErrorCode extends ErrorCode>( | ||
error: ErrorLoggerData<TErrorCode> | ||
) => void; | ||
log: <TErrorData>(error: VechainSDKError<TErrorData>) => void; | ||
} | ||
@@ -61,0 +54,0 @@ : // Logger function type used for 'log' logs |
@@ -52,7 +52,7 @@ "use strict"; | ||
` | ||
****************** ERROR: ${error.errorCode} ****************** | ||
****************** ERROR ON: ${error.methodName} ****************** | ||
- Error message: '${error.errorMessage}' | ||
- Error data: | ||
`, | ||
error.errorData, | ||
error.data, | ||
` | ||
@@ -59,0 +59,0 @@ - Internal error: |
{ | ||
"name": "@vechain/sdk-logging", | ||
"version": "1.0.0-beta.24", | ||
"version": "1.0.0-beta.25", | ||
"description": "This module provides functionality to logging data for vechain-sdk", | ||
@@ -36,4 +36,4 @@ "author": "vechain Foundation", | ||
"dependencies": { | ||
"@vechain/sdk-errors": "1.0.0-beta.24" | ||
"@vechain/sdk-errors": "1.0.0-beta.25" | ||
} | ||
} |
@@ -1,3 +0,3 @@ | ||
import type { ErrorLoggerData, LogFunctionType } from '../types'; | ||
import type { ErrorCode } from '@vechain/sdk-errors'; | ||
import type { LogFunctionType } from '../types'; | ||
import { type VechainSDKError } from '@vechain/sdk-errors'; | ||
@@ -8,8 +8,8 @@ /** | ||
const _logErrorFunction: LogFunctionType<'error'> = { | ||
log: <TErrorCode extends ErrorCode>(error: ErrorLoggerData<TErrorCode>) => { | ||
log: <TErrorData>(error: VechainSDKError<TErrorData>) => { | ||
console.error( | ||
`\n****************** ERROR: ${error.errorCode} ******************\n` + | ||
`\n****************** ERROR ON: ${error.methodName} ******************\n` + | ||
`- Error message: '${error.errorMessage}'` + | ||
'\n- Error data:\n', | ||
error.errorData, | ||
error.data, | ||
`\n- Internal error:\n`, | ||
@@ -16,0 +16,0 @@ error.innerError, |
@@ -1,2 +0,6 @@ | ||
import { type DataType, type ErrorCode } from '@vechain/sdk-errors'; | ||
import { | ||
type DataType, | ||
type ErrorCode, | ||
type VechainSDKError | ||
} from '@vechain/sdk-errors'; | ||
@@ -43,8 +47,3 @@ /** | ||
* | ||
* VeChainSDKLogger('error').log({ | ||
* errorCode: DATA.INVALID_DATA_TYPE, | ||
* errorMessage: 'Message we want to use for invalid data type ...', | ||
* errorData: input, | ||
* innerError: new Error('This is the inner error') | ||
* }); | ||
* VeChainSDKLogger('error').log(new JSONRPCInternalError('test-method', -32603, `Error on request`, { some: 'data' })); | ||
* | ||
@@ -56,5 +55,3 @@ */ | ||
? { | ||
log: <TErrorCode extends ErrorCode>( | ||
error: ErrorLoggerData<TErrorCode> | ||
) => void; | ||
log: <TErrorData>(error: VechainSDKError<TErrorData>) => void; | ||
} | ||
@@ -61,0 +58,0 @@ : // Logger function type used for 'log' logs |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17363
370
+ Added@vechain/sdk-errors@1.0.0-beta.25(transitive)
- Removed@vechain/sdk-errors@1.0.0-beta.24(transitive)