All Projects → rochacbruno-archive → raise_if

rochacbruno-archive / raise_if

Licence: other
one liner `raise Exception if condition` for Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to raise if

Bugsnag Laravel
Bugsnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.
Stars: ✭ 746 (+4873.33%)
Mutual labels:  errors, exceptions
Bugsnag Python
Official bugsnag error monitoring and error reporting for django, flask, tornado and other python apps.
Stars: ✭ 69 (+360%)
Mutual labels:  errors, exceptions
Bugsnag Android
Bugsnag crash monitoring and reporting tool for Android apps
Stars: ✭ 990 (+6500%)
Mutual labels:  errors, exceptions
Collision
💥 Collision is a beautiful error reporting tool for command-line applications
Stars: ✭ 3,993 (+26520%)
Mutual labels:  errors, exceptions
Bugsnag Cocoa
Bugsnag crash reporting for iOS, macOS and tvOS apps
Stars: ✭ 167 (+1013.33%)
Mutual labels:  errors, exceptions
Bugsnag Php
Bugsnag error monitoring and crash reporting tool for PHP apps
Stars: ✭ 475 (+3066.67%)
Mutual labels:  errors, exceptions
Bugsnag Node
[DEPRECATED] Please upgrade to our Universal JS notifier "@bugsnag/js" • https://github.com/bugsnag/bugsnag-js
Stars: ✭ 48 (+220%)
Mutual labels:  errors, exceptions
mwe-cpp-exception
Minimum working example of proper C++11 exception handling
Stars: ✭ 20 (+33.33%)
Mutual labels:  exceptions, exception-handler
Bugsnag Go
Automatic panic monitoring for Go and Go web frameworks, like negroni, gin, and revel
Stars: ✭ 155 (+933.33%)
Mutual labels:  errors, exceptions
Periskop
Exception Monitoring Service
Stars: ✭ 115 (+666.67%)
Mutual labels:  errors, exceptions
periskop
Exception Monitoring Service
Stars: ✭ 128 (+753.33%)
Mutual labels:  errors, exceptions
Bugsnag Ruby
Bugsnag error monitoring & reporting software for rails, sinatra, rack and ruby
Stars: ✭ 211 (+1306.67%)
Mutual labels:  errors, exceptions
easybuggy4django
EasyBuggy clone built on Django
Stars: ✭ 44 (+193.33%)
Mutual labels:  errors, exceptions
Traceback with variables
Adds variables to python traceback. Simple, lightweight, controllable. Debug reasons of exceptions by logging or pretty printing colorful variable contexts for each frame in a stacktrace, showing every value. Dump locals environments after errors to console, files, and loggers. Works in Jupyter and IPython. Install with pip or conda.
Stars: ✭ 509 (+3293.33%)
Mutual labels:  errors, exceptions
crash
Proper error handling, exceptions and try/catch for ZSH
Stars: ✭ 51 (+240%)
Mutual labels:  exceptions, exception-handler
Bugsnag Android Ndk
DEPRECATED - this project now lives at bugsnag/bugsnag-android
Stars: ✭ 42 (+180%)
Mutual labels:  errors, exceptions
ExceptionCatcher
Catch Objective-C exceptions in Swift
Stars: ✭ 97 (+546.67%)
Mutual labels:  exceptions, exception-handler
Exception Track
Tracking ⚠️ exceptions for Rails application and store them in database.
Stars: ✭ 102 (+580%)
Mutual labels:  errors, exceptions
Easybuggy
Too buggy web application
Stars: ✭ 189 (+1160%)
Mutual labels:  errors, exceptions
bugsnag-java
Bugsnag error reporting for Java.
Stars: ✭ 51 (+240%)
Mutual labels:  errors, exceptions

Build Status Coverage Status Utility Emacs

forthebadge forthebadge forthebadge

raise_if

Python could have raise conditions like Ruby.

def i_must_have_truth(value)
  raise TypeError, 'You must give me truth' if value == false
end

But the only one line option that works hurts PEP8

def i_must_have_truth(value):
    if not value: raise TypeError('You must give me truth')

So..

$ pip install raise_if

import raise_if

def i_must_have_truth(value):
    raise_if(not value, TypeError, 'You must give me truth')

Pass exception type and arguments

raise_if(not 1 == 2, TypeError, 'Fails', another_arg='foo')

or

raise_if(not 1 == 2, TypeError('Fails', another_arg='foo'))

Why??

Because I am lazy and I do not like extra breaks in a chain of if statements!

:)

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].