-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display exception info in PolyglotInspector
and improve Polyglot class#signalPolyglotError
- Loading branch information
Showing
8 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
5 changes: 4 additions & 1 deletion
5
src/TruffleSqueak-Core.package/Polyglot.class/class/signalPolyglotError.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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
helpers | ||
signalPolyglotError | ||
self error: self primitiveLastError | ||
| error | | ||
error := self primitiveLastError. | ||
error inspect. | ||
self error: error asString |
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
21 changes: 21 additions & 0 deletions
21
src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/exceptionInfoFor..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,21 @@ | ||
helpers | ||
exceptionInfoFor: anInteropException | ||
^ 'Message: {1} | ||
Cause: {2} | ||
Type: {3} | ||
Stack trace: | ||
- {4}' format: { | ||
(Interop hasExceptionMessage: anInteropException) | ||
ifFalse: [ 'n/a' ] | ||
ifTrue: [ Interop getExceptionMessage: anInteropException ]. | ||
(Interop hasExceptionCause: anInteropException) | ||
ifFalse: [ 'n/a' ] | ||
ifTrue: [ Interop getExceptionCause: anInteropException ]. | ||
Interop getExceptionType: anInteropException. | ||
(Interop hasExceptionStackTrace: anInteropException) | ||
ifFalse: [ 'n/a' ] | ||
ifTrue: [ ((Interop getExceptionStackTrace: anInteropException) asCollection | ||
collect: [ :ea | ((Interop hasExecutableName: ea) | ||
ifTrue: [ (Interop getExecutableName: ea) ] | ||
ifFalse: [ ea ]) asString ]) joinSeparatedBy: String cr, '- ' ] } |
7 changes: 7 additions & 0 deletions
7
src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/fieldException.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 @@ | ||
fields | ||
fieldException | ||
|
||
^ (self newFieldForType: #misc key: #exception) | ||
name: 'language info'; emphasizeName; | ||
valueGetter: [ :o | self exceptionInfoFor: o ]; printValueAsIs; | ||
yourself |
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
2 changes: 1 addition & 1 deletion
2
...pector.class/instance/getLanguageInfo..st → ...pector.class/instance/languageInfoFor..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
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