Skip to content

Catching errors from service calling external API #4182

@bobby91560

Description

@bobby91560

Hello,

How can I catch an error and the request made when calling a external API using services and loopback-connector-rest ? My purpose is to log the response's error in a different way than Loopback.

Example of what I want to do :

      try {
        await this.someService.someMethod(someObject);
      }
      catch(e) {
        logger.error(request);
      }

Thanks in advance

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions