Getting Started
Installation
bash
npm install try-asAdd the transform to your build and keep it last:
bash
asc assembly/index.ts --transform try-asOr in asconfig.json:
json
{
"options": {
"transform": ["try-as"]
}
}If you use multiple transforms, keep try-as last.
Basic usage
ts
import { Exception } from "try-as";
try {
throw new Error("boom");
} catch (e) {
const err = e as Exception;
console.log(err.toString());
}