Skip to content

Instantly share code, notes, and snippets.

@k1r0s
Created June 3, 2017 14:51
Show Gist options
  • Select an option

  • Save k1r0s/2e6a309bcddecd1ae6d16341cd5c112d to your computer and use it in GitHub Desktop.

Select an option

Save k1r0s/2e6a309bcddecd1ae6d16341cd5c112d to your computer and use it in GitHub Desktop.
capturing exceptions with kaop-ts
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