try

external fun <T : JsAny?> try(block: () -> T): Promise<T>(source)

MDN Reference