bsimmons
/** Convert promise with HTTP 500 response to failed promise. */ fun Promise<Response>.handleErrorCodes(): Promise<Response> = then { response -> if(response.ok) response else response.text().then { body -> throw RuntimeException("${response.status}: $body") } }.then { it as Response }
thana
Promise<Promise<T>>
Promise<T>
then {it}
turansky
A modern programming language that makes developers happier.