Skip to content

Conversation

@loganek
Copy link
Collaborator

@loganek loganek commented Sep 27, 2022

This is helpful if the user uses different logging technique and wants to get error message back to their system

This breaks public API and I'm not sure how do we proceed with this kind of changes (assuming you're happy to accept it). Could you please provide a recommendation or point me to a process related to releasing backward-incompatible changes? Optionally we can make the last two arguments default (e.g. set error_buf to NULL and if that's the case, the wasm_instance_new_with_args will use internal buffer) however I find this a bit polluting the API, so would rather avoid default arguments in that case.

This is helpful if the user uses different logging technique and wants to get error message back to their system
@lum1n0us
Copy link
Collaborator

In my opinion, I don't suggest to change signature of any released public API. I always tend to create a new one.

But in this case, I believe we should use wasm_trap_t and its wasm_message_t to pass error message. Caller could use wasm_trap_message to retrieve information, and wasm_trap_trace to get call stack if it is provided.

@yamt
Copy link
Collaborator

yamt commented Nov 2, 2022

i agree it's better to use a trap, at least for a subset of errors.

@loganek
Copy link
Collaborator Author

loganek commented Nov 24, 2022

makes sense, resolving as we already have #1751

@loganek loganek closed this Nov 24, 2022
wenyongh pushed a commit that referenced this pull request Nov 25, 2022
Create trap for error message when wasm_instance_new fails:
- Similar to [this PR](#1526),
   but create a wasm_trap_t to output the error msg instead of adding error_buf to the API.
- Trap will need to be deleted by the caller but is not a breaking change as it is only
   created if trap is not NULL.
- Add error messages for all failure cases here, try to make them accurate but welcome
  feedback for improvements.

Signed-off-by: Andrew Chambers <[email protected]>
NingW101 pushed a commit to NingW101/wasm-micro-runtime that referenced this pull request Dec 1, 2022
…lliance#1751)

Create trap for error message when wasm_instance_new fails:
- Similar to [this PR](bytecodealliance#1526),
   but create a wasm_trap_t to output the error msg instead of adding error_buf to the API.
- Trap will need to be deleted by the caller but is not a breaking change as it is only
   created if trap is not NULL.
- Add error messages for all failure cases here, try to make them accurate but welcome
  feedback for improvements.

Signed-off-by: Andrew Chambers <[email protected]>
wenyongh pushed a commit that referenced this pull request Dec 6, 2022
Create trap for error message when wasm_instance_new fails:
- Similar to [this PR](#1526),
   but create a wasm_trap_t to output the error msg instead of adding error_buf to the API.
- Trap will need to be deleted by the caller but is not a breaking change as it is only
   created if trap is not NULL.
- Add error messages for all failure cases here, try to make them accurate but welcome
  feedback for improvements.

Signed-off-by: Andrew Chambers <[email protected]>
wenyongh pushed a commit that referenced this pull request Dec 19, 2022
Create trap for error message when wasm_instance_new fails:
- Similar to [this PR](#1526),
   but create a wasm_trap_t to output the error msg instead of adding error_buf to the API.
- Trap will need to be deleted by the caller but is not a breaking change as it is only
   created if trap is not NULL.
- Add error messages for all failure cases here, try to make them accurate but welcome
  feedback for improvements.

Signed-off-by: Andrew Chambers <[email protected]>
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…lliance#1751)

Create trap for error message when wasm_instance_new fails:
- Similar to [this PR](bytecodealliance#1526),
   but create a wasm_trap_t to output the error msg instead of adding error_buf to the API.
- Trap will need to be deleted by the caller but is not a breaking change as it is only
   created if trap is not NULL.
- Add error messages for all failure cases here, try to make them accurate but welcome
  feedback for improvements.

Signed-off-by: Andrew Chambers <[email protected]>
@loganek loganek deleted the loganek/extend-wasm-instance-new branch June 10, 2024 12:48
g0djan pushed a commit to g0djan/wasm-micro-runtime that referenced this pull request Sep 30, 2024
…lliance#1751)

Create trap for error message when wasm_instance_new fails:
- Similar to [this PR](bytecodealliance#1526),
   but create a wasm_trap_t to output the error msg instead of adding error_buf to the API.
- Trap will need to be deleted by the caller but is not a breaking change as it is only
   created if trap is not NULL.
- Add error messages for all failure cases here, try to make them accurate but welcome
  feedback for improvements.

Signed-off-by: Andrew Chambers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants