1.0.11 • Published 2 years ago

annotation-exception-handlers v1.0.11

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

typescript library

annotation-exception-handlers is a library that allows you to write a try and catch block using annotation that makes your code more arranged like this @validate("name your function").

NPM

npm i annotation-exception-handlers

Demo

 import validate from "annotation-exception-handlers/validate";

 class test {
    constructor() {}


    // this function not fire error so all functionality  call on correct way
    // print hellow saeed 
    @validate("function_without_error")
    function_without_error() {
      console.log(" hello saeed 1")
    }


    // this function   fire error so all functionality  not work
    // print method that fire error and error message
    @validate("function_with_error")
    function_with_error() {
        throw 'this error because you not make star  for this library ^_^';
        console.log(" hello saeed 2")
    }

   // if you want customize  error function you can override the default 
   // for example send email
   error(error) {

    // TODO: sned email that contain error messgae 
    console.log(error)
}
 

}

About me

name:Saeed Mohammed Saleh Alabidi email: saeed1adm@gmail.com

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago