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
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 192. CompileError(AbstractException)>>outer @2 line 193. [] in UndefinedObject(TDAbstractEnvironment)>>_compileBlock: @9 line 114. Array(Collection)>>do: @5 line 105. [] in TDStandardEnvironment(TDAbstractEnvironment)>>_compileBlock: @4 line 86. CompileError(AbstractException)>>_executeHandler: @3 line 87. CompileError(AbstractException)>>_signalFromPrimitive: @1 line 18. String>>_compileInContext:symbolList:oldLitVars:environmentId: @1 line 19. String>>_compileInContext:symbolList:oldLitVars:environmentId:flags: @2 line 310. [] in UndefinedObject(TDAbstractEnvironment)>>_compile:inContext:literalVars:tempSymbolList:environmentId: @3 line 511. [] in TDStandardEnvironment(TDAbstractEnvironment)>>_compileBlock: @3 line 212. TDStandardEnvironment(ExecBlock)>>on:do: @3 line 4213. TDStandardEnvironment(TDAbstractEnvironment)>>_compileBlock: @3 line 314. TDStandardEnvironment(TDAbstractEnvironment)>>_compile:inContext:literalVars:tempSymbolList:environmentId: @2 line 315. TDStandardEnvironment(TDAbstractEnvironment)>>compile:inContext:literalVars:tempSymbolList:environmentId: @2 line 316. TDStandardEnvironment(TDAbstractEnvironment)>>evaluate:in:literalVars:tempSymbolList:environmentId: @2 line 317. TDTopezServer>>evaluateString:inContext:literalVars:withTempSymbolList:environmentId: @4 line 518. [] in TDShellTool>>eval @6 line 1519. OrderedCollection(Collection)>>do: @5 line 1020. TDShellTool>>eval @5 line 1121. TDShellTool class(TDAbstractDevTool class)>>performCommand:withSelector:objIn:commandOptions:todeCommand: @14 line 1022. TDShellTool class(TDAbstractDevTool class)>>performCommand:objIn:commandOptions:todeCommand: @2 line 323. [] in TDShellTool class>>eval @2 line 524. TDShellTool class(ExecBlock)>>cull:cull:cull:cull: @7 line 425. TDTopezServer>>evaluateCommand:objIn: @18 line 2226. TDTopezServer>>evaluateSTONCommand: @9 line 627. Executed Code28. GsNMethod class>>_gsReturnToC @1 line 1
Ideas and suggestions on how to solve these would be much appreciated
_______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass
Free forum by Nabble | Edit this page |