Describe the bug.
The AsyncAPI Generator attempts to submit anonymous usage metrics even after generation has already failed with a fatal error. This results in an additional runtime error being printed, which is unrelated to the actual cause of the failure and pollutes the output.
Metrics submission should only occur after a successful generation or a clean shutdown, not after a hard failure.
Expected behavior
- Generation should abort immediately after a fatal error.
- No attempt should be made to submit anonymous metrics.
- No secondary or unrelated errors should be printed.
Screenshots
How to Reproduce
- Create a non-empty output directory:
mkdir out
echo test > out/file.txt
- Use the following AsyncAPI document:
asyncapi: '2.6.0'
info:
title: Metrics Failure Test
version: '1.0.0'
channels: {}
- Run the generator:
asyncapi generate asyncapi.yaml @asyncapi/html-template --output ./out
- Current Behavior
The generator fails as expected due to the non-empty output directory, but then prints an additional error related to metrics submission:
Generator Error: "./out" is not an empty directory. You might override your work.
Skipping submitting anonymous metrics due to the following error: TypeError: fetch failed
🖥️ Device Information [optional]
- Operating System (OS):Windows(WSL)
- Browser:
- Browser Version:
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes I am willing to submit a PR!
Describe the bug.
The AsyncAPI Generator attempts to submit anonymous usage metrics even after generation has already failed with a fatal error. This results in an additional runtime error being printed, which is unrelated to the actual cause of the failure and pollutes the output.
Metrics submission should only occur after a successful generation or a clean shutdown, not after a hard failure.
Expected behavior
Screenshots
How to Reproduce
The generator fails as expected due to the non-empty output directory, but then prints an additional error related to metrics submission:
🖥️ Device Information [optional]
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes I am willing to submit a PR!