[Glass] GsDevKit and tode debugger

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Mon Sep 17 23:59:55 PDT 2018


Jon,

For running gems and capturing continuations in your REST server, you 
_could_ take a look at the gsApplicationTools[1] and using Zinc REST 
support with gsApplicationTools[2] ...

For Seaside REST, I would think that the standard Seaside error handling 
should apply, but I don't see any thing that looks like a an error 
handler on the stack and I would have expected to see one of the 
following error handling classes invoked:

    WAExceptionHandler
     WAErrorHandler
      WADebugErrorHandler
       WAWalkbackErrorHandler
        WAGemStoneWalkbackErrorHandler
         WARemoteDebuggingWalkbackErrorHandler
      WAEmailErrorHandler
      WAHtmlErrorHandler
       WAHtmlHaltAndErrorHandler
        WAGemStoneProductionErrorHandler
      WAInteractiveGemServerErrorHandler
      WASignalingErrorHandler

It's been awhile since I've played with Seaside REST, but I would have 
expected that the normal Seaside error handling would come into play for 
RESTful calls, but perhaps that is not the case?

If the Seaside error handlers are not being installed on the stack, then 
inside SersHandler>>handleResult: or SersHandler>>executeResult: you put 
in the following code (expansion of Jupiter's suggestion) that will snap 
off continuations and save them to the object log:

[ self doMyRestThing ]
     on: Error , Halt, Warning
     do: [ :ex |
         GRPlatform current doTransaction: [
             (ex isKindOf: Warning)
                 ifTrue: [
                     "record warning message in object log"
                     (ObjectLogEntry warn: ex description) addToLog ]
                 ifFalse: [
                     "record continuation in object log"
                     (DebuggerLogEntry createContinuationLabeled: ex 
description) addToLog ]] ]

If there is the potential for commit conflicts, then you need to be 
prepared to handle a failed commit (false result from doTransaction:) 
and as a fallback bump a stack to the the gem log ...

As I say, I am a bit surprised that the Seaside error handlers are not 
being invoked ...

Dale

[1] 
https://github.com/GsDevKit/gsApplicationTools/blob/master/docs/gettingStarted.md#getting-started-with-gem-servers
[2] 
https://github.com/GsDevKit/gsApplicationTools/blob/master/docs/rest.md#gemserver-support-for-zinc-rest

On 09/12/2018 04:38 AM, Jon Paynter via Glass wrote:
> Hi All,
>
> Im starting a new project with GsDevKit and glass as the backend 
> server.  The idea is to use the seaside REST interface to communicate 
> to my UI layer.
>
> Installation went MUCH better than last time i tried this.  Kudos to 
> Dale for getting everything running smoothly.  Im running gemstone v 
> 3.2.10
>
> I have a tode client running on my windows PC, which connects to stone 
> running in a ubuntu VM.  I can write code just fine and see it serve 
> up my REST calls.  but when it comes to trying to debug anything, its 
> not working.
>
> my expectation is when an exception occurs -- I should see a 
> continuation in the object log.  instead all I see in the object log 
> is a message saying topaz has quit.
>
> at first I thought it was due to my choice of error handler in the 
> seaside config for my rest service. but all of them have the same results.
>
> See attached the zinc_server log file -- I put a 'self halt' in my 
> domain code.
>
>
> Also on a (possibly?) related note, I cant figure out how to run 
> arbitrary code in gemstone from the tode client.  I tried using the 
> 'eval' command but that always gives me a compile error.  And using 
> the 'do it' option from within a code browser has no effect.
>
> eval 'Array new' ==>
> a CompileError occurred (error 1001), compilation errors -- parameter 
> 1 is error descriptor
> --------------------
> 1. CompileError(AbstractException)>>_outer:with: @8 line 19
> 2. CompileError(AbstractException)>>outer @2 line 19
> 3. [] in UndefinedObject(TDAbstractEnvironment)>>_compileBlock: @9 line 11
> 4. Array(Collection)>>do: @5 line 10
> 5. [] in TDStandardEnvironment(TDAbstractEnvironment)>>_compileBlock: 
> @4 line 8
> 6. CompileError(AbstractException)>>_executeHandler: @3 line 8
> 7. CompileError(AbstractException)>>_signalFromPrimitive: @1 line 1
> 8. String>>_compileInContext:symbolList:oldLitVars:environmentId: @1 
> line 1
> 9. 
> String>>_compileInContext:symbolList:oldLitVars:environmentId:flags: 
> @2 line 3
> 10. [] in 
> UndefinedObject(TDAbstractEnvironment)>>_compile:inContext:literalVars:tempSymbolList:environmentId: 
> @3 line 5
> 11. [] in TDStandardEnvironment(TDAbstractEnvironment)>>_compileBlock: 
> @3 line 2
> 12. TDStandardEnvironment(ExecBlock)>>on:do: @3 line 42
> 13. TDStandardEnvironment(TDAbstractEnvironment)>>_compileBlock: @3 line 3
> 14. 
> TDStandardEnvironment(TDAbstractEnvironment)>>_compile:inContext:literalVars:tempSymbolList:environmentId: 
> @2 line 3
> 15. 
> TDStandardEnvironment(TDAbstractEnvironment)>>compile:inContext:literalVars:tempSymbolList:environmentId: 
> @2 line 3
> 16. 
> TDStandardEnvironment(TDAbstractEnvironment)>>evaluate:in:literalVars:tempSymbolList:environmentId: 
> @2 line 3
> 17. 
> TDTopezServer>>evaluateString:inContext:literalVars:withTempSymbolList:environmentId: 
> @4 line 5
> 18. [] in TDShellTool>>eval @6 line 15
> 19. OrderedCollection(Collection)>>do: @5 line 10
> 20. TDShellTool>>eval @5 line 11
> 21. TDShellTool class(TDAbstractDevTool 
> class)>>performCommand:withSelector:objIn:commandOptions:todeCommand: 
> @14 line 10
> 22. TDShellTool class(TDAbstractDevTool 
> class)>>performCommand:objIn:commandOptions:todeCommand: @2 line 3
> 23. [] in TDShellTool class>>eval @2 line 5
> 24. TDShellTool class(ExecBlock)>>cull:cull:cull:cull: @7 line 4
> 25. TDTopezServer>>evaluateCommand:objIn: @18 line 22
> 26. TDTopezServer>>evaluateSTONCommand: @9 line 6
> 27. Executed Code
> 28. GsNMethod class>>_gsReturnToC @1 line 1
>
>
> Ideas and suggestions on how to solve these would be much appreciated
>
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20180918/c540e820/attachment.html>


More information about the Glass mailing list