foam-framework / foam-framework/foam

when calling model.getRuntimeProperties error handling needs to be present

Open
#349 3 comments 0 reactions 1 assignee Claimed by @kgrgreer View on GitHub
bug error-reporting
Dominant language
JavaScript
Stars
783
Forks
51
PR merge metrics
No merged PRs in 30d

Description

If someone writes code that omits a requires to import a model, they will later get an inscrutable stack trace that says that model.getRuntimeProperties is undefined.

It is not even possible to set a breakpoint on the line and reload to see what model is the problem; the reader has to find the call buried in the stack trace that references the model name.

Instead, if getRuntimeProperties is undefined, the code should at least print out the name of the model that's undefined and suggest that the user has missed a requires statement. In a perfect universe, it would tell the author which model is missing the requires, too.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.