Hi. I'm trying to capture error logging in Notebooks or Dataflows in Azure Synapse Workspace.
I have tried a few approaches, passing the string value from the activity as a Dynamic Content.
Raise and Error here simply takes input and uses it for the following method: throw new InvalidOperationException(message); I then use the dynamic content to attempt to store this in storage using the dynamic content. activity('Raise an Error').error.errorCode
The above example is a dataflow but I've tried this with notebooks in pyspark and .Net Spark(C#). I invariably get different errors. The input into my second activity I get it is "ErrorDescription": "'System.InvalidOperationException: File creation\n at Submission#18.<<Initialize>>d__0.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsyncTResult'" The errors I get include 1. Pyspark: EOL error 2. .NET Spark: errors similar to "Evalue": "(1,205): error CS1056: Unexpected character '`'\n(1,206): error CS1002: ; expected", 3. Dataflows: Expression cannot be parsed. Details:Parameter stream has parsing errors\nLine 13 Position 17: extraneous input ''' expecting {DECIMAL_LITERAL, HEX_LITERAL, OCT_LITERAL, BINARY_LITERAL, '-', '!', '$', '~', ':', '(', '#', '[', '@(', '[]', FLOAT_LITERAL, HEX_FLOAT_LITERAL, STRING_LITERAL, REGEX_LITERAL, 'parameters', 'functions', 'as', 'input', 'output', 'constant', 'expression', 'integer', 'short', 'long', 'double', 'float', 'decimal', 'boolean', 'timestamp', 'date', 'byte', 'binary', 'integral', 'number', 'fractional', 'any', IDENTIFIER, ANY_IDENTIFIER, META_MATCH, '$$', OPEN_INTERPOLATE}","failureType":"UserError","target":"Data flow1","errorCode":"DF-Executor-ParseError"}
I have tried replace() on the error code and trim() for leading \n\n\n - which works for simple strings but not for actual error messages. I have also tried to convert the error using binary(). In this last case my output is: ErrorDescription": { "value": { "$content-type": "application/octet-stream", "$content": "U3lzdGVtLkludmFsaWRPcGVyYXRpb25FeGNlcHRpb246IEZpbGUgY3JlYXRpb24KICAgYXQgU3VibWlzc2lvbiMxOC48PEluaXRpYWxpemU+PmRfXzAuTW92ZU5leHQoKQotLS0gRW5kIG9mIHN0YWNrIHRyYWNlIGZyb20gcHJldmlvdXMgbG9jYXRpb24gd2hlcmUgZXhjZXB0aW9uIHdhcyB0aHJvd24gLS0tCiAgIGF0IE1pY3Jvc29mdC5Db2RlQW5hbHlzaXMuU2NyaXB0aW5nLlNjcmlwdEV4ZWN1dGlvblN0YXRlLlJ1blN1Ym1pc3Npb25zQXN5bmNbVFJlc3VsdF0oSW1tdXRhYmxlQXJyYXlgMSBwcmVjZWRpbmdFeGVjdXRvcnMsIEZ1bmNgMiBjdXJyZW50RXhlY3V0b3IsIFN0cm9uZ0JveGAxIGV4Y2VwdGlvbkhvbGRlck9wdCwgRnVuY2AyIGNhdGNoRXhjZXB0aW9uT3B0LCBDYW5jZWxsYXRpb25Ub2tlbiBjYW5jZWxsYXRpb25Ub2tlbik=" }, "type": "string" }, This seems promising as I suspect if I can get the $content: portion I suspect I code decode it but can't find any advice on how to handle the resultng System.Collections.Generic.Dictionary`2[System.String,System.Object]. Any suggestions on the approach to take would be helpful. I'm happy to put in the work but just have currently exhausted my ideas.