All Projects → molovo → crash

molovo / crash

Licence: MIT license
Proper error handling, exceptions and try/catch for ZSH

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to crash

mwe-cpp-exception
Minimum working example of proper C++11 exception handling
Stars: ✭ 20 (-60.78%)
Mutual labels:  exceptions, exception-handler
tipz
Gives you helpful hints when you execute a command for which you have an alias defined
Stars: ✭ 24 (-52.94%)
Mutual labels:  zsh-plugin, zsh-plugins
ExceptionCatcher
Catch Objective-C exceptions in Swift
Stars: ✭ 97 (+90.2%)
Mutual labels:  exceptions, exception-handler
zsh-poetry
🐚 Simple ZSH plugin for automatically activating and deactivating Poetry-created virtualenvs. 🐍
Stars: ✭ 43 (-15.69%)
Mutual labels:  zsh-plugin, zsh-plugins
dotfiles
⚫️ ~ is where the ♥ is - my dotfiles.
Stars: ✭ 94 (+84.31%)
Mutual labels:  zsh-plugin, zsh-plugins
git
Provides nice git aliases and functions.
Stars: ✭ 26 (-49.02%)
Mutual labels:  zsh-plugin, zsh-plugins
aterminal
🎉 An oh-my-zsh plugin for show platform versions
Stars: ✭ 31 (-39.22%)
Mutual labels:  zsh-plugin, zsh-plugins
Awesome Zsh Plugins
A collection of ZSH frameworks, plugins, themes and tutorials.
Stars: ✭ 10,129 (+19760.78%)
Mutual labels:  zsh-plugin, zsh-plugins
Zsh Nvm
Zsh plugin for installing, updating and loading nvm
Stars: ✭ 1,670 (+3174.51%)
Mutual labels:  zsh-plugin, zsh-plugins
tumult.plugin.zsh
Tumult is a collection of macOS-specific functions and scripts for your shell environment. It is packaged as a ZSH plugin, but can be used with other shells as well.
Stars: ✭ 147 (+188.24%)
Mutual labels:  zsh-plugin, zsh-plugins
raise if
one liner `raise Exception if condition` for Python
Stars: ✭ 15 (-70.59%)
Mutual labels:  exceptions, exception-handler
vcrtl
C++ Exceptions in Windows Drivers
Stars: ✭ 141 (+176.47%)
Mutual labels:  exceptions
ErrorControlSystem
ErrorControlSystem is a .NET library created to automate handling .NET Windows-Base application exceptions and raise that to a sql server. This exception handler have some features as screen capturing, fetch server date time in exception occurrence time and etc.
Stars: ✭ 30 (-41.18%)
Mutual labels:  exception-handler
T-Header
Termux customization with your own name (termux-banner + custom PS1) and oh-my-zsh themes with plugins
Stars: ✭ 296 (+480.39%)
Mutual labels:  zsh-plugins
custom-exception-middleware
Middleware to catch custom or accidental exceptions
Stars: ✭ 30 (-41.18%)
Mutual labels:  exceptions
zsh-startup-timer
A zsh plugin to print the time it takes for the shell to start up
Stars: ✭ 18 (-64.71%)
Mutual labels:  zsh-plugin
exceptions-java
Curso Tratamento de Exceções em Java
Stars: ✭ 489 (+858.82%)
Mutual labels:  exceptions
easybuggy4django
EasyBuggy clone built on Django
Stars: ✭ 44 (-13.73%)
Mutual labels:  exceptions
wakatime-zsh-plugin
🕒Track how much time you have spent in your terminal!
Stars: ✭ 71 (+39.22%)
Mutual labels:  zsh-plugin
zsh-aws-vault
oh-my-zsh plugin for aws-vault
Stars: ✭ 63 (+23.53%)
Mutual labels:  zsh-plugin

Crash

Build Status Join the chat at https://gitter.im/molovo/crash

Proper error handling, exceptions and try/catch for ZSH.

Crash Screenshot

Installation

zulu

zulu install crash

Manual

git clone https://github.com/molovo/crash crash
cp crash/crash /usr/local/share/zsh/site-functions # Or anywhere else in $fpath

Usage

Set up the global error handler

Crash comes with a global error handler, which prints a readable error and stack trace both for user-created exceptions and traditional shell exit codes.

autoload -Uz crash && crash register

throw TestException 'This is a test' # Will cause the error handler to be displayed

Try/catch

Crash comes with the functions try, catch and throw, allowing you to handle exceptions much as you would in a 'proper' programming language.

autoload -Uz crash && crash register

# The function we're going to call
function do_something() {
  echo 'Start to do something...'
  throw RainbowException 'Unicorns!'
  echo 'This message will never be displayed'
}

# A function to handle any caught exceptions
function error_handler() {
  local exception="$1" message="${(@)@:2}"

  echo $exception # RainbowException
  echo $message   # Unicorns!
}

try do_something
catch RainbowException error_handler

License

Copyright (c) 2016 James Dinsdale [email protected] (molovo.co)

Crash is licensed under The MIT License (MIT)

Team

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