[Advanced] Handling x-error With "IF" When Using "Open X-Callback URL"
Hey all,
When invoking the "Open X-Callback URL" action from within a shortcut, is it possible to handle an error that arises from within the calling shortcut via x-error?
For example
- Format data to pass into URL Scheme
- Pass URL into "Open X-Callback URL"
- App with URL Scheme produces an error and returns to shortcuts with error message
- **I want to be able to handle the error from
x-errorby using anIfstatement
Some documentation I've already looked at
- Official Shortcuts Documentation on X-Callaback URL
- Official x-callback-url spec
My Shorcut
https://www.icloud.com/shortcuts/c4df65503d96496687e9fd262f39d6da
I'm working on a Shortcut that will pull Github Issues and add them as tasks to Things 3.
Right now I am using "Open X-Callaback URL" to invoke the correct Things URL Scheme and passing in JSON data.
Everything works great, except when the task in Things that has been removed and cann't be found when performing update. This produces an error.
Now things will execute x-error and pass the error message back to Shortcuts. When this happens, Shortcuts renders a popup menu with the message and OK button. Can I avoid this?
How do I handle the callback error with an IF statement in Shortcuts? Otherwise, can I configure a URL Scheme to tell Shortcuts to jump directly to an action in a Shortcut
Posted Dec 7, 2018, 12:33 AM UTC
I don’t have the Things app to test it but try adding &x-error=shortcuts://run-shortcut?name=Github%20%E2%86%92%20Things%20(shared) to the url, that should call your Shortcut again and you might get and input you can test, so if the shortcut gets no input then keep going but if you get something then you can handle it from there.
Having said that I’m not sure it’ll work without adding “&input=“ to the url but is worth to try it anyways, I know some apps support placeholders like “{{error}}” or similar for this kind of situations but I don’t know if Things use them.