justadudewhohacks / justadudewhohacks/opencv4nodejs

Properly handle std::runtime_error and throw it in node.js

Open
#696 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.1k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

# Error Message

**terminate called after throwing an instance of 'std::runtime_error'**
what(): OpenCV Error: (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in Mat, in file /var/repo/DistributionCenterDemo/NuvoolaFR/node_modules/opencv-build/opencv/opencv/modules/core/src/matrix.cpp, line 466, status -215
Aborted (core dumped)

The process is aborted without knowing what line triggered it in node.js

This is a common error you get with a incorrect call to getRegion() for example. It's easy to trace when there is a few call but become cumbersome to debug in bigger code.

If properly handled, it would "bubble" the error in the application and we could have a call trace, and handle the error without terminating the process.

## Environment

*OpenCV version* (example 3.4.1): 3.4.6

*With OpenCV-contrib?* (extra modules): yes/no? yes

*OS*: Windows 7 / 8 / 10? / MacOSX? / Ubuntu? Ubuntu 18.04

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.