question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

uncaught exception: cancel

See original GitHub issue

This error will show when i click “cancel” button in Sweetalert2

swal({ title: menu_title, text: title, input: "text", showCancelButton: true, animation: "slide-from-top", showLoaderOnConfirm: true, inputPlaceholder: lang.write_your_comment, preConfirm: function(inputValue) { return new Promise(function(resolve, reject) { resolve('ok'); }); }) }, allowOutsideClick: false }).then(function(result){ var res = $.parseJSON(result); if(res.status){ swal({ title: lang.thankyou+"!", text: lang.your_feedback_sent, type: "success" }).then(function(confirm){ location.reload(); }); } else{ swal({ title: lang.sorry+"!", text: res.message, type: "warning" }); } });

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
eminxcommented, Apr 1, 2018

In case someone comes here and gets stuck (because sweetalert != sweetalert2!)

At the end of the swal({...}), add this: .catch(() => swal.close())

Every promise function needs a failure callback.

0reactions
SantiM96commented, Dec 22, 2020

@eminx me too!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exceptions in coroutines. Cancellation and Exceptions in…
When a coroutine fails with an exception, it will propagate said exception up to its parent! Then, the parent will 1) cancel the...
Read more >
vue axios Uncaught (in promise) Cancel - Stack Overflow
I see an error message saying "Uncaught (in promise) Cancel" even though the I used catch function to handle exceptions.
Read more >
Coroutine exceptions handling | Kotlin Documentation
This section covers exception handling and cancellation on exceptions. We already know that a cancelled coroutine throws ...
Read more >
Kotlin Coroutine Job Hierarchy — Succeed, Fail, and Cancel
- Uncaught exception in a child, by default, cancels parent. In particular, this applies to children created with launch coroutine builder. Note ...
Read more >
Exception handling in Kotlin Coroutines - Kt. Academy
Just as a program breaks when an uncaught exception slips by, a coroutine breaks in ... The difference is that coroutine builders also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found