전체 맥락이 정확히 무엇인지 확실하지는 않지만, 이렇게 해볼 수 있을 것 같습니다:
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
try {
// ...
} catch (e) {
popupAjaxError(e);
}
// 또는
ajax("...") // 어떤 함수
.then(() => {
// ...
})
.catch(popupAjaxError);