Skip to content

Conversation

@almilosz
Copy link
Contributor

Details:

  • Each error msg concerned the 'compiledModelSync' method.
  • A new parameter with method name was added to get_parameters_error_msg

@almilosz almilosz requested a review from a team as a code owner June 28, 2024 05:47
@github-actions github-actions bot added the category: JS API OpenVino JS API Bindings label Jun 28, 2024
};

std::string get_parameters_error_msg(const Napi::CallbackInfo& info, std::vector<std::string>& allowed_signatures);
std::string get_parameters_error_msg(const Napi::CallbackInfo& info,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to consider if this function is not to specialized instead build string for signatures it do more.
What if name is not required or there will be need something else.

Maybe leave this function unchanged to build signature string and use assert macro to build final message where required.

OPENVINO_THROW("Method 'my_method' called with invalid parameters\n", ov::js::get_parameters_signature_str(info, allowed_signatures));

Macro build message with exact location (file, line), so maybe give method name is not required at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exact location points to C++ implementation of method that may have a different name in JS API.
Here it's readModelSync vs read_model_sync, but in some cases it might be quite confusing for a user.

@almilosz almilosz added this pull request to the merge queue Jul 1, 2024
Merged via the queue into openvinotoolkit:master with commit 5480d41 Jul 1, 2024
@almilosz almilosz deleted the almilosz/fix/error-msg branch July 1, 2024 12:44
AsyaPronina pushed a commit to AsyaPronina/openvino that referenced this pull request Jul 1, 2024
### Details:
 - Each error msg concerned the 'compiledModelSync' method. 
- A new parameter with method name was added to
`get_parameters_error_msg`

---------

Co-authored-by: Vishniakov Nikolai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: JS API OpenVino JS API Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants