Created
June 3, 2017 14:51
-
-
Save k1r0s/2e6a309bcddecd1ae6d16341cd5c112d to your computer and use it in GitHub Desktop.
capturing exceptions with kaop-ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { AdvicePool, adviceMetadata, IMetadata } from 'kaop-ts' | |
| export class Advices extends AdvicePool { | |
| static blameCovfefe (@adviceMetadata meta: IMetadata) { | |
| meta.exception.message += " despite the constant negative press covfefe" | |
| } | |
| static throwOnError (@adviceMetadata meta: IMetadata) { | |
| if(meta.exception) { | |
| throw meta.exception | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment