Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detailed exception messages are required. #38

Closed
samchon opened this issue Jun 14, 2019 · 2 comments
Closed

Detailed exception messages are required. #38

samchon opened this issue Jun 14, 2019 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects

Comments

@samchon
Copy link
Owner

samchon commented Jun 14, 2019

Until now, exceptions thrown by TSTL had not provided enough information. Exception.message had stored only fragmentary words. It may possible to inference reason of the exception occurrence by reading Error.stack, but it seems not intuitive:

Invalid range. Paramter first is greater than last.

To provide detailed exception information in Exception.message level, I'll upgrade the TSTL to express the source object, method and parameters onto the Exception.message property like such below:

Error on std.Vector.erase(): first iterator has greater index than last -> (first = 4, last = 2).

@samchon samchon added the enhancement New feature or request label Jun 14, 2019
@samchon samchon added this to To do in v2.2 Update via automation Jun 14, 2019
@samchon samchon moved this from To do to In progress in v2.2 Update Jun 14, 2019
@samchon
Copy link
Owner Author

samchon commented Jun 15, 2019

Detailed exception messages thrown by TSTL have been updated like such below:

name message
OutOfRange Error on std.Vector.at(): parametric index is negative -> (index = -1).
OutOfRange Error on std.Vector.at(): parametric index is equal or greater than size -> (index = 1, size: 0).
OutOfRange Error on std.Vector.set(): parametric index is negative -> (index = -1).
OutOfRange Error on std.Vector.set(): parametric index is equal or greater than size -> (index = 1, size: 0).
InvalidArgument Error on std.Vector.insert(): parametric iterator is not this container's own.
OutOfRange Error on std.Vector.insert(): parametric iterator is directing negative position -> (index = -1).
InvalidArgument Error on std.Vector.erase(): parametric iterator is not this container's own.
OutOfRange Error on std.Vector.erase(): first is directing negative position -> (first = -1).
RangeError Error on std.Vector.erase(): first iterator has greater index than last -> (first = 4, last = 2).
InvalidArgument Error on std.List.insert(): parametric iterator is not this container's own.
InvalidArgument Error on std.List.erase(): parametric iterator is not this container's own.
OutOfRange Error on std.HashMap.get(): unable to find the matched key -> 3.
OutOfRange Error on std.HashMap.extract(): unable to find the matched key -> 3.
InvalidArgument Error on std.advance(): parametric iterator is not a bi-directional iterator, thus advancing to negative direction is not possible.
InvalidArgument Error on std.cyl_bessel_j(): n must be integer when x is negative -> (n = 2.3, x = -5).
InvalidArgument Error on std.cyl_bessel_j(): n must be zero when x is zero -> (n = 2.3, x = 0).
InvalidArgument Error on std.cyl_neumann(): x must be greater than zero -> (x = -4).
InvalidArgument Error on std.cyl_bessel_i(): n must be integer when x is negative -> (n = -2.1, x = -0.5).
InvalidArgument Error on std.cyl_bessel_i(): n must be zero when x is zero -> (n = 2.3, x = 0).
InvalidArgument Error on std.cyl_bessel_k(): requires x > 0 -> (x = -0.3).
InvalidArgument Error on std.ellint_3(): must be v < (1 / sin^2(phi)) -> (v = 2.0050289151424696, 1 / sin^2(phi) = 1.0050289151424694).
InvalidArgument Error on std.hermite(): n must be unsigned integer -> (n = -5).
InvalidArgument Error on std.assoc_laguerre(): both n and m must be unsigned integer -> (n = -1, m = -1).
InvalidArgument Error on std.assoc_legendre(): both n and m must be unsigned integer -> (n = -1, m = -1).
InvalidArgument Error on std.assoc_legendre(): must be
InvalidArgument Error on std.SharedMutex.unlock(): this mutex is free on the unique lock.
InvalidArgument Error on std.SharedMutex.unlock_shared(): this mutex is free on the shared lock.
OutOfRange Error on std.experimental.Semaphore.release(): parametric count is less than 1 -> (count = 0).
OutOfRange Error on std.experimental.Semaphore.release(): parametric count is greater than max -> (count = 5, max = 4).
OutOfRange Error on std.experimental.Semaphore.release(): parametric count is greater than acquiring -> (count = 2, acquiring = 0).

@samchon samchon moved this from In progress to Done in v2.2 Update Jun 15, 2019
@samchon
Copy link
Owner Author

samchon commented Jun 15, 2019

Have implemented until v2.2

@samchon samchon closed this as completed Jun 15, 2019
@samchon samchon added the help wanted Extra attention is needed label Jun 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
No open projects
v2.2 Update
  
Done
Development

No branches or pull requests

1 participant