Skip to content

Error Messages

Jon Drobny edited this page Dec 1, 2021 · 5 revisions

Error Messages

rustBCA uses the anyhow crate to add context to error messages produced by the code so that the cause of the error can be located by and explained to the user. For example, if the absolute tolerance of the CPR rootfinder is set too fine, the code will produce the following error message:

Processing 20 ions... Initializing with 8 threads... [00:00:00] [####>-----------------------------------] 10% thread '<unnamed>' panicked at 'called Result::unwrap() on an Err value: Numerical error: CPR Rootfinder failed to converge when calculating distance of closest approach for Er = 1881.4633630066912 eV p = 0.6377656515934431 A using Morse potential with D = 0.14655064898407008 eV, alpha = 1.1836 1/A, and r0 = 3.73 A.  Caused by:     Subdivision reached interval limit without converging. Consider relaxing epsilon or increasing N_max. F(a) = -0.569812751852526 F(b) = 0.9999999999999999

Processing 20 ions...
Initializing with 8 threads...
[00:00:00] [####>-----------------------------------] 10%
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Numerical error: CPR Rootfinder failed to converge when calculating distance of closest approach for Er = 1881.4633630066912 eV p = 0.6377656515934431 A using Morse potential with D = 0.14655064898407008 eV, alpha = 1.1836 1/A, and r0 = 3.73 A.

Caused by:
    Subdivision reached interval limit without converging. Consider relaxing epsilon or increasing N_max. F(a) = -0.569812751852526 F(b) = 0.9999999999999999