Skip to content

Commit

Permalink
Logging all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiehewitt15 committed Aug 1, 2024
1 parent b45d819 commit 9103b95
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/core/handler/ddoHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ export class GetDdoHandler extends Handler {
status: { httpStatus: 200 }
}
} catch (error) {
CORE_LOGGER.error(`Get DDO error: ${error}`)
return {
stream: null,
status: { httpStatus: 500, error: 'Unknown error: ' + error.message }
Expand Down
1 change: 1 addition & 0 deletions src/components/core/handler/downloadHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ export class DownloadHandler extends Handler {
}
provider = blockchain.getProvider()
} catch (e) {
CORE_LOGGER.error('Download JsonRpcProvider ERROR: ' + e.message)
return {
stream: null,
status: {
Expand Down
3 changes: 3 additions & 0 deletions src/components/core/handler/encryptHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
buildInvalidRequestMessage,
validateCommandParameters
} from '../../httpRoutes/validateCommands.js'
import { CORE_LOGGER } from '../../../utils/logging/common.js'

// for encryption
export const SUPPORTED_ENCRYPTION_ENCODINGS = ['string', 'base58']
Expand Down Expand Up @@ -70,6 +71,7 @@ export class EncryptHandler extends Handler {
status: { httpStatus: 200 }
}
} catch (error) {
CORE_LOGGER.error(`Error while encrypting data: ${error} `)
return {
stream: null,
status: { httpStatus: 500, error: 'Unknown error: ' + error.message }
Expand Down Expand Up @@ -130,6 +132,7 @@ export class EncryptFileHandler extends Handler {
}
}
} catch (error) {
CORE_LOGGER.error(`Error while encrypting file: ${error} `)
return {
stream: null,
status: { httpStatus: 500, error: 'Unknown error: ' + error.message }
Expand Down
3 changes: 3 additions & 0 deletions src/components/core/handler/queryHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
buildInvalidParametersResponse,
validateCommandParameters
} from '../../httpRoutes/validateCommands.js'
import { CORE_LOGGER } from '../../../utils/logging/common.js'

export class QueryHandler extends Handler {
validate(command: QueryCommand): ValidateParams {
Expand All @@ -28,6 +29,7 @@ export class QueryHandler extends Handler {
status: { httpStatus: 200 }
}
} catch (error) {
CORE_LOGGER.error(`Error in QueryHandler: ${error.message}`)
return {
stream: null,
status: { httpStatus: 500, error: 'Unknown error: ' + error.message }
Expand All @@ -49,6 +51,7 @@ export class QueryDdoStateHandler extends QueryHandler {
status: { httpStatus: 200 }
}
} catch (error) {
CORE_LOGGER.error(`Error in QueryDdoStateHandler: ${error.message}`)
return {
stream: null,
status: { httpStatus: 500, error: 'Unknown error: ' + error.message }
Expand Down
2 changes: 2 additions & 0 deletions src/components/core/handler/statusHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ValidateParams,
validateCommandParameters
} from '../../httpRoutes/validateCommands.js'
import { CORE_LOGGER } from '../../../utils/logging/common.js'

export class StatusHandler extends Handler {
validate(command: StatusCommand): ValidateParams {
Expand Down Expand Up @@ -34,6 +35,7 @@ export class StatusHandler extends Handler {
status: { httpStatus: 200 }
}
} catch (error) {
CORE_LOGGER.error(`Error in StatusHandler: ${error.message}`)
return {
stream: null,
status: { httpStatus: 500, error: 'Unknown error: ' + error.message }
Expand Down

0 comments on commit 9103b95

Please sign in to comment.