All Projects → jw3126 → ArgCheck.jl

jw3126 / ArgCheck.jl

Licence: other
Package for checking function arguments

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to ArgCheck.jl

Bugsnag Cocoa
Bugsnag crash reporting for iOS, macOS and tvOS apps
Stars: ✭ 167 (+128.77%)
Mutual labels:  errors
Wtfiswronghere
A collection of simple errors that beginners are likely to hit when they start writing Python.
Stars: ✭ 240 (+228.77%)
Mutual labels:  errors
raise if
one liner `raise Exception if condition` for Python
Stars: ✭ 15 (-79.45%)
Mutual labels:  errors
Ajv Errors
Custom error messages in JSON-Schema for Ajv
Stars: ✭ 185 (+153.42%)
Mutual labels:  errors
Escaya
An blazing fast 100% spec compliant, incremental javascript parser written in Typescript
Stars: ✭ 217 (+197.26%)
Mutual labels:  errors
errors
errors with paired message and caller stack frame
Stars: ✭ 19 (-73.97%)
Mutual labels:  errors
Nestjs Flub
Pretty Error 😫 Stack Viewer for NestJS Framework 🛠️
Stars: ✭ 158 (+116.44%)
Mutual labels:  errors
easybuggy4django
EasyBuggy clone built on Django
Stars: ✭ 44 (-39.73%)
Mutual labels:  errors
Merry
Golang errors with stacktrace and context
Stars: ✭ 230 (+215.07%)
Mutual labels:  errors
bugsnag-java
Bugsnag error reporting for Java.
Stars: ✭ 51 (-30.14%)
Mutual labels:  errors
Easybuggy
Too buggy web application
Stars: ✭ 189 (+158.9%)
Mutual labels:  errors
Bugsnag Ruby
Bugsnag error monitoring & reporting software for rails, sinatra, rack and ruby
Stars: ✭ 211 (+189.04%)
Mutual labels:  errors
fail
Better error handling solution specially designed for web application servers
Stars: ✭ 27 (-63.01%)
Mutual labels:  errors
Whoops
PHP errors for cool kids
Stars: ✭ 12,646 (+17223.29%)
Mutual labels:  errors
rakered
The open source components from rake.red
Stars: ✭ 28 (-61.64%)
Mutual labels:  errors
Nginx Error Pages
Cute Error Pages for your nginx web server
Stars: ✭ 166 (+127.4%)
Mutual labels:  errors
Node Common Errors
Common error classes and utility functions
Stars: ✭ 247 (+238.36%)
Mutual labels:  errors
errorlocate
Find and replace erroneous fields in data using validation rules
Stars: ✭ 19 (-73.97%)
Mutual labels:  errors
karma-go
Everything has a reason.
Stars: ✭ 15 (-79.45%)
Mutual labels:  errors
errorsingo.com
Hugo static site setup for errorsingo.com
Stars: ✭ 25 (-65.75%)
Mutual labels:  errors

ArgCheck

CI codecov.io

Installation

Pkg.add("ArgCheck")

Usage

using ArgCheck

function f(x,y)
    @argcheck cos(x) < sin(y)
    # doit
end

f(0,0)
ERROR: ArgumentError: cos(x) < sin(y) must hold. Got
cos(x) => 1.0
sin(y) => 0.0

You can also customize the error:

@argcheck k > n
@argcheck size(A) == size(B) DimensionMismatch
@argcheck det(A) < 0 DomainError
@argcheck false MyCustomError(my, args...)
@argcheck isfinite(x) "custom error message"

Performance

@argcheck code is as fast as @assert or a hand written if. That being said it is possible to erase argchecks, much like one can erase bounds checking using @inbounds. This is implemented in OptionalArgChecks.jl:

using OptionalArgChecks # this also reexports ArgCheck.jl for convenience

f(x) = @argcheck x > 0

@unsafe_skipargcheck f(-1)

This feature is currently experimental. It may be silently changed or removed without increasing the major ArgCheck version number. See the OptionalArgChecks documentation for some of the caveats.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].