-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from freemansoft/features/exceptions
Expand on Exception toString()
- Loading branch information
Showing
5 changed files
with
40 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
class ProcessTokenException { | ||
class ProcessTokenException implements Exception { | ||
final String message; | ||
final Object originalException; | ||
|
||
ProcessTokenException(this.message, this.originalException); | ||
|
||
@override | ||
String toString() { | ||
return 'ProcessTokenException{message: $message, wrapped: $originalException}'; | ||
} | ||
} |
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,17 @@ | ||
import 'package:figma2flutter/exceptions/process_token_exception.dart'; | ||
import 'package:figma2flutter/exceptions/resolve_token_exception.dart'; | ||
import 'package:test/expect.dart'; | ||
import 'package:test/scaffolding.dart'; | ||
|
||
void main() { | ||
test('ProcessTokenException message', () { | ||
expect( | ||
ProcessTokenException( | ||
'hello', | ||
ResolveTokenException('some wrapped exception'), | ||
).toString(), | ||
equals( | ||
'ProcessTokenException{message: hello, wrapped: ResolveTokenException{message: some wrapped exception}}'), | ||
); | ||
}); | ||
} |
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,12 @@ | ||
import 'package:figma2flutter/exceptions/resolve_token_exception.dart'; | ||
import 'package:test/expect.dart'; | ||
import 'package:test/scaffolding.dart'; | ||
|
||
void main() { | ||
test('ProcessTokenException message', () { | ||
expect( | ||
ResolveTokenException('some wrapped exception').toString(), | ||
equals('ResolveTokenException{message: some wrapped exception}'), | ||
); | ||
}); | ||
} |