Concept Flow - Promise error handling
Create Promise
Promise runs async task
Task succeeds?
No→Reject with error
Catch error handler
Resolve with value
Handle error
Then handler runs
End
This flow shows how a Promise runs an async task, then either resolves successfully or rejects with an error, which can be caught and handled.