FEniCS/dolfinx

Using exception subtypes

オープン

#2,398 opened on 2022/10/07

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)C++ (255 件のフォーク)auto 404
enhancementgood first issuehousekeeping

Repository metrics

Stars
 (1,158 個のスター)
PR merge metrics
 (PR metrics pending)

説明

SonarCloud complains about our exception throwing, and I think it makes sense:

If you throw a general exception type, such as std::exception, std::logic_error or std::runtime_error, it forces consumers to catch all exceptions, including unknown exceptions they don’t necessarily know how to handle.

Instead, either throw a subtype that already exists ( for example in ), or create your own type that derives from a standard one.

https://wiki.sei.cmu.edu/confluence/display/java/ERR07-J.+Do+not+throw+RuntimeException%2C+Exception%2C+or+Throwable

コントリビューターガイド