diff --git a/src/TruffleSqueak-Core.package/Polyglot.class/class/signalPolyglotError.st b/src/TruffleSqueak-Core.package/Polyglot.class/class/signalPolyglotError.st index 205d85382..917b6dfde 100644 --- a/src/TruffleSqueak-Core.package/Polyglot.class/class/signalPolyglotError.st +++ b/src/TruffleSqueak-Core.package/Polyglot.class/class/signalPolyglotError.st @@ -1,3 +1,6 @@ helpers signalPolyglotError - self error: self primitiveLastError \ No newline at end of file + | error | + error := self primitiveLastError. + error inspect. + self error: error asString \ No newline at end of file diff --git a/src/TruffleSqueak-Core.package/Polyglot.class/methodProperties.json b/src/TruffleSqueak-Core.package/Polyglot.class/methodProperties.json index 71ddc3cdc..f94b35298 100644 --- a/src/TruffleSqueak-Core.package/Polyglot.class/methodProperties.json +++ b/src/TruffleSqueak-Core.package/Polyglot.class/methodProperties.json @@ -50,7 +50,7 @@ "primitiveIsPolyglotEvalAllowed" : "fn 1/5/2020 16:58", "primitiveLastError" : "fn 10/2/2019 09:09", "setUpPolyglotEnvironment" : "fn 1/24/2020 14:41", - "signalPolyglotError" : "fn 4/13/2019 14:08", + "signalPolyglotError" : "fn 6/10/2021 16:15", "startUp:" : "fn 1/24/2020 14:41" }, "instance" : { } } diff --git a/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/exceptionInfoFor..st b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/exceptionInfoFor..st new file mode 100644 index 000000000..884fb25a9 --- /dev/null +++ b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/exceptionInfoFor..st @@ -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, '- ' ] } \ No newline at end of file diff --git a/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/fieldException.st b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/fieldException.st new file mode 100644 index 000000000..9fadbd97b --- /dev/null +++ b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/fieldException.st @@ -0,0 +1,7 @@ +fields +fieldException + + ^ (self newFieldForType: #misc key: #exception) + name: 'language info'; emphasizeName; + valueGetter: [ :o | self exceptionInfoFor: o ]; printValueAsIs; + yourself \ No newline at end of file diff --git a/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/fieldLanguageInfo.st b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/fieldLanguageInfo.st index 90699d427..12d31b15e 100644 --- a/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/fieldLanguageInfo.st +++ b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/fieldLanguageInfo.st @@ -3,6 +3,6 @@ fieldLanguageInfo ^ (self newFieldForType: #misc key: #language) name: 'language info'; emphasizeName; - valueGetter: [ :o | self getLanguageInfo: o ]; printValueAsIs; + valueGetter: [ :o | self languageInfoFor: o ]; printValueAsIs; valueGetterExpression: 'Interop getLanguageInfo: self'; yourself \ No newline at end of file diff --git a/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/getLanguageInfo..st b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/languageInfoFor..st similarity index 93% rename from src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/getLanguageInfo..st rename to src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/languageInfoFor..st index 7920f2b9b..800d4aea2 100644 --- a/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/getLanguageInfo..st +++ b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/languageInfoFor..st @@ -1,5 +1,5 @@ helpers -getLanguageInfo: anObject +languageInfoFor: anObject | info | info := (Interop getLanguageInfo: anObject). ^ 'Name: {1} diff --git a/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/streamOptionalFieldsOn..st b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/streamOptionalFieldsOn..st index 191c5d994..ee90b58ef 100644 --- a/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/streamOptionalFieldsOn..st +++ b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/instance/streamOptionalFieldsOn..st @@ -11,5 +11,7 @@ streamOptionalFieldsOn: aStream aStream nextPut: self fieldLanguageInfo ]. (Interop hasSourceLocation: self object) ifTrue: [ aStream nextPut: self fieldSource ]. + (Interop isException: self object) ifTrue: [ + aStream nextPut: self fieldException ]. (Interop hasMembers: self object) ifTrue: [ aStream nextPutAll: self fieldsMembers ]. \ No newline at end of file diff --git a/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/methodProperties.json b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/methodProperties.json index 783666e06..473c5f5a1 100644 --- a/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/methodProperties.json +++ b/src/TruffleSqueak-Tools-Core.package/PolyglotInspector.class/methodProperties.json @@ -3,20 +3,22 @@ }, "instance" : { "aboutToStyle:" : "fn 12/5/2018 19:14", - "fieldLanguageInfo" : "fn 4/11/2021 15:02", + "exceptionInfoFor:" : "fn 6/10/2021 17:15", + "fieldException" : "fn 6/10/2021 16:48", + "fieldLanguageInfo" : "fn 6/10/2021 16:48", "fieldMetaName" : "fn 4/11/2021 15:02", "fieldMetaObject" : "fn 4/11/2021 15:01", "fieldMetaObjectInfo" : "fn 4/11/2021 15:02", "fieldSource" : "fn 4/11/2021 15:02", "fieldsMembers" : "fn 4/11/2021 15:02", - "getLanguageInfo:" : "fn 2/12/2021 10:27", "initialExtent" : "fn 2/12/2021 10:35", "inspect:" : "fn 11/21/2019 15:47", "inspectAs:" : "fn 1/26/2021 16:04", "inspectVMObject" : "fn 3/29/2021 16:40", "labelString" : "fn 2/11/2021 12:28", + "languageInfoFor:" : "fn 6/10/2021 16:47", "mainFieldListMenu:" : "fn 3/29/2021 16:39", "streamArrayElementsOn:" : "fn 4/11/2021 15:03", "streamBaseFieldsOn:" : "fn 2/11/2021 11:01", "streamFieldsOn:" : "fn 2/11/2021 11:49", - "streamOptionalFieldsOn:" : "fn 2/19/2021 13:36" } } + "streamOptionalFieldsOn:" : "fn 6/10/2021 16:46" } }