Closed agriffis closed 2 years ago
In node, we can catch an axios failure
const axios = require('axios') axios.get('https://aeoifjasodifjaosiejfaoisedjfaoisdjf.com') .then(() => console.log('woo')) .catch(() => console.log('boo')) //=> prints "boo" on console
In promesa, this doesn't seem to work
(ns foo (:require [promesa.core :as p] ["axios$default" :as axios])) (p/-> (axios/get "https://aeoifjasodifjaosiejfaoisedjfaoisdjf.com") (p/then #(js/console.log "woo")) (p/catch #(js/console.log "boo"))) ;=> nothing is printed
I've tried a bunch of things, but it seems like neither then nor catch is called when axios fails in promesa.
then
catch
Bah, I was using p/-> when I need simple -> in this case.
p/->
->
In node, we can catch an axios failure
In promesa, this doesn't seem to work
I've tried a bunch of things, but it seems like neither
then
norcatch
is called when axios fails in promesa.