OSC /fail parameters and associating to the correct command?

My c++ code communicates via OSC to sclang on bela mini, and I want to make sure I can handle asynchronous commands that fail. I could associate by only the command name, but I’m wondering if I need to also compare the bufferId. The documentation describes the params in case of a /done, but not a /fail. Does /fail have a format like done, but with just an extra error string up front?

Thanks,
Paul

Agreed that documentation is not detailed enough here. My suggestion would be to trigger failures and print out the messages, to discover what is sent back, e.g.:

OSCdef(\printFail, { |msg| msg.postln }, '/fail');

s.boot;

b = Buffer.read(s, "thisfiledoesntexist.wav");

[/fail, /b_allocRead, File 'thisfiledoesntexist.wav' could not be opened: System error : No such file or directory.
, 0]

// Buffer.new, not .alloc: buffer doesn't exist in the server
c = Buffer(s, 2048, 1, 1000);

// huh, no /fail message -- probably there should be
c.sine1([1]);

c.getn(0, 100, _.postln);

[/fail, /b_getn, index out of range]  // erm... no buffer number, rats

The last example shows a/ not every command that can fail will issue a /fail message and b/ in some cases, you can’t determine precisely which command failed, except by issuing the commands one by one.

hjh

Also: There’s a bit of a negative feedback loop about /fail messages, where the implementation has holes, so nobody uses them, so nobody improves them, resulting in people not using them…

So if you need unambiguous /fail messages that are consistently emitted wherever needed, and if you worked on that in the scsynth code base and submitted a PR… it would be very very welcome. Sometimes things like this don’t improve until someone needs it, and they fix it for their own needs, and publish the fix for everyone else.

hjh