Forum

VL.Telegram

vl
vvvv

#1

hey there,

i’m working on a new version of the telegram contribution, this time as VL-based nodes.

basic functionality is there already but some issues remain. will post them as soon as these could be adressed. stay tuned…


#2

question to the devs:

i’m fighting with exception handling in VL: the communication between the base library and the telegram servers happens mostly by async function calls, which internally create HTTP requests. when the request return errors (e.g. 404) an exception is thrown.
executing the calling function from within a try-region does not catch the exception (maybe because it happens async?). is there a way to catch these exceptions?

------------------------------------------------------------------------------
Exception class: EClrException
Exception message: Response status code does not indicate success: 404 (Not Found).
Exception address: 0000000000000000
------------------------------------------------------------------------------
System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
   at VL.Core.RuntimeGraph.HandleException(UInt32 rootId) in C:\BuildAgent\work\95074898639d5736\public-vl\VL.Core\src\RuntimeGraph.cs:line 123
   at VVVV.VL.Hosting.NodePlugin.Evaluate(Int32 spreadMax) in C:\BuildAgent\work\95074898639d5736\vvvv50\VVVV.VLIntegration\src\NodePlugin.cs:line 0

#3

if you use Task.Result (which is blocking) the exception should be thrown in the region.

then wrap everything in an AsyncTask region to get the async behavior back…


#4

thanks @tonfilm . this way it is possible to catch the exception. unfortunately i’m loosing the info on what kind of exception was causing the troubles as the try-region only outputs a string like “one or more errors caused the exception”.

on the other hand when not using an async region and using HoldLatestError it is possible to catch the cause but the exception is rethrown, which I’d like to prevent.

any idea how to get the type of exception and catch it also?


#5

the TryCatch region has a catch operation inside, there you get the full .NET exception. note that this region has two layers inside, Try and Catch. you need to assign your nodes to one or the other.


#6

i was looking into TryCatch already but i’m not sure how that region would help me, as the output of the Catch-layer has to be of the same data-type as the Try layer.

the only thing I could think of would be the creation of a new type (or tuple), wrapping type and some string to output it together, and unwrap it outside. this feels quite awkward as one part of this structure would always be empty - is there a more elegant way?


#7

grafik
grafik

Well, it seems to do the trick. If there are more elegant solutions, please tell…


#8

there should be a TryCatch with two outputs which saves you the tuple. or are you on beta36?


#9

good idea, but anyways then i’m stuck with the single output from AsyncTask. so it seems the tuple is the way to go…


#10

alright - first version to try is here:

VL.Telegram.0.0.1.zip (114.1 KB)

nuget is in the working…


Undeletable Ghost-Pins