-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #341: Prevent that errors are hidden during commits
The ifRejected: [nil] in actionCommit turned the effective Promise for the save into one that always gets resolved rather than rejected. But the promise is also rejected if the user cancels the save dialog. Now waitFor: will signal either the inner Error (or rather a copy of it) or the BrokenPromise if it was not rejected with an Error.
- Loading branch information
Showing
8 changed files
with
24 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/Squot.package/BrokenPromise.extension/instance/ifError.ifNotError..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
*Squot-Tools | ||
ifError: errorBlock ifNotError: rejectedBlock | ||
| reason | | ||
reason := self reason. | ||
^ (reason isKindOf: Error) | ||
ifTrue: [errorBlock cull: reason] | ||
ifFalse: [rejectedBlock cull: reason] |
7 changes: 1 addition & 6 deletions
7
src/Squot.package/BrokenPromise.extension/instance/ifNotError..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*Squot-Tools | ||
reason | ||
| nested | | ||
nested := promise. | ||
[(nested isKindOf: Promise) and: [nested isRejected]] whileTrue: [nested := nested error]. | ||
^ nested |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters