how can you extract mutiple values from catch?
emaayan opened this issue · 1 comments
emaayan commented
hi..
according to cockpit promises, the catch portion may return an additional parameter
https://cockpit-project.org/guide/latest/cockpit-spawn.html
from what i understand you can't have more then one value on a callback in promise
zbynek commented
In case it's still relevant: you can access extra arguments by calling Js.arguments()
. Alternatively you can define your own class for the promise, similar to elemental2.promise.Promise
, but change CatchOnRejectedCallbackFn
to accept multiple arguments (since this is a difference between standard Promise and Cockpit API, it should not be part of Elemental).