LogError

utils/logErrors~ LogError

new LogError(properties)

Description:
  • Constructor for LogError class.
Source:
Properties:
Name Type Description
properties.timestamp Date Timestamp of the error (generated automatically).
properties.message String Error message.
properties.error String Error details (optional).
properties.status Number HTTP status code (defaults to 500).
endpoint String Endpoint where the error occurred (optional, It will be taken from request in the error middlewere).
Parameters:
Name Type Description
properties Object Properties for the log error.

Methods

add(key) → {String}

Description:
  • Method to add a LogError instance to logErrors object.
Source:
Parameters:
Name Type Description
key String The key to identify the log error.
Returns:
- The key used to identify the log error. We will use it to identify the log error in the error middlewere.
Type
String