Skip to content

Errors not bubbling up #1231

Open
Open
@andreafspeziale

Description

@andreafspeziale

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Hello! Recently I was doing some housekeeping in my projects and one of them is using nest-commander.

The project is about a simple CLI to interact with OpenSearch in a convenient way.

When running the CLI will leverage @nestjs/config in order to check a couple of ENV variables. If the variable is expected and not set the code will throw a ConfigException.

As you can see from the attached screenshot I can see the log about the error

Image

but the throw seems somehow ignored

Image

It wont happen in regular nestjs projects

Image

Minimum reproduction code

You can just download and run my project:

At this point all CLI commands should throw since expected env is missing, you can run whatever like

  • node dist/os-cli.js

Expected behavior

The thrown error to be reported

Package

  • nest-commander
  • nest-commander-schematics
  • nest-commander-testing

Package version

3.16.1

Node.js version

v22.14.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

You can chat me on X or Discord (added u) to check it out together if needed. Thank you for your help and work 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions