Capturing the actual error from server - it does not work

Server-side function:

DSI::datashield.aggregate(connection,expression,asynchronous)

DANGER_Error <- function(){stop(“SERVER::ERR:0001”)}

Client-side call: server.call <- call(‘DANGER_Error’) print(server.call) DSI::datashield.aggregate(connections,server.call) print(DSI::datashield.errors())

Outcome: DANGER_Error() NULL

Why is the error set in the stop completed on the server, not sent back to the client?

Thank you for letting me know how I can achieve this. Cheers. P.

#yannickMarcon #dev-support #StuartWheater

Patricia,

via the Opal web-portal I deployed a function “dummyDS.assign”, script “{ stop(‘Some Message’) }” and was able to invoke the function via “DSI::datashield.assign(…)” without any problem. The “DSI::datashield.errors()” did return a message containing ‘Some Message’ + lots of other stuff.

Server-side function:

DSI::datashield.aggregate(connection,expression,asynchronous)

Not sure what you mean by this “DSI::datashield.aggregate” is a client side function.

Stuart

DSI has two functions; datashield.assign and datashield.aggregate. ds.assign calls datashield.assign.

So, the situation appears that datashield.assign may be able to capture data, but not datashield.aggregate.

It would be much better, if both would capture errors from the servers in the same manner. It would be more consistent.

Thank you for posting this additional information. #yannick can you help?

Cheers,

P.

Hi,

Both datashield.assign and datashield.aggregate are implemented with try-catch (since version 1.1.x), then any server error will be reported to client.

Yannick

It is asking me to use datashield.error to show the errors. However, it is not showing anything. that is the point. can you please provide an example of server-side code and client-side code that would capture the errors and works. It would be helpful.

cheers,

P.

Hi,

The quotes used in your script are not valid. See explanations and side-effects in this discussion: Unexpected R server error?

Yannick