Skip to content

fix(cli): handle invalid numeric arguments gracefully#4602

Open
Meetjain1 wants to merge 5 commits intoWasmEdge:masterfrom
Meetjain1:fix-cli-invalid-args
Open

fix(cli): handle invalid numeric arguments gracefully#4602
Meetjain1 wants to merge 5 commits intoWasmEdge:masterfrom
Meetjain1:fix-cli-invalid-args

Conversation

@Meetjain1
Copy link

@Meetjain1 Meetjain1 commented Feb 2, 2026

This PR fixes a crash in the CLI when invalid numeric arguments are passed.

When non-numeric or out-of-range values (for example "abc" or very large integers) are provided, the CLI previously threw uncaught exceptions and aborted. This change adds exception handling around numeric argument parsing so the CLI fails gracefully with a clear error message and a proper exit code.

Closes #4588

CI checks - Meetjain1#2

image

@Meetjain1 Meetjain1 requested a review from ibmibmibm as a code owner February 2, 2026 13:24
@github-project-automation github-project-automation bot moved this to Triage-required in WasmEdge Roadmap Feb 2, 2026
@github-actions github-actions bot added the c-CLI An issue related to WasmEdge CLI tools label Feb 2, 2026
@Meetjain1 Meetjain1 marked this pull request as draft February 2, 2026 13:35
@Meetjain1 Meetjain1 marked this pull request as ready for review February 2, 2026 13:56
@Meetjain1 Meetjain1 marked this pull request as draft February 2, 2026 14:07
@Meetjain1 Meetjain1 marked this pull request as ready for review February 2, 2026 17:11
@Meetjain1 Meetjain1 force-pushed the fix-cli-invalid-args branch from c3abd83 to 7ed763b Compare February 4, 2026 16:29
@Meetjain1
Copy link
Author

@hydai PTAL on this PR.

@github-project-automation github-project-automation bot moved this from Triage-required to In progress in WasmEdge Roadmap Feb 12, 2026
@Meetjain1 Meetjain1 force-pushed the fix-cli-invalid-args branch from ae96e74 to 56e5a7b Compare February 12, 2026 18:22
@Meetjain1 Meetjain1 requested a review from hydai February 12, 2026 18:23
@Meetjain1
Copy link
Author

Meetjain1 commented Feb 12, 2026

@hydai Addressed all comments with latest CI checks Meetjain1#2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c-CLI An issue related to WasmEdge CLI tools

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

bug: CLI crashes on invalid numeric arguments due to unhandled std::sto* exceptions

3 participants