Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.
I've tried to make it as lean and unobtrusive as possible.
errors/AppError.js
| [...] | |
| if [[ "$(umask)" = "0000" ]]; then | |
| umask 0022 | |
| fi | |
| export DOCKER_HOST=tcp://localhost:2375 |
| #!/usr/bin/env bash | |
| ## Uncomment to disable git info | |
| #POWERLINE_GIT=0 | |
| __powerline() { | |
| # Colors | |
| COLOR_RESET='\[\033[m\]' | |
| COLOR_CWD=${COLOR_CWD:-'\[\e[1m\]\[\e[36m\]'} | |
| COLOR_GIT=${COLOR_GIT:-'\[\e[1m\]\[\e[35m\]'} |
| #pragma once | |
| #include <exception> | |
| #include <string> | |
| class CustomException : public std::exception | |
| { | |
| public: | |
| CustomException(const std::string &error) : msg("[CUSTOM]: " + error) {}; | |
| ~CustomException() = default; |