arcalot / arcaflow-plugin-sdk-go

Go SDK for writing Arcaflow plugins
https://pkg.go.dev/go.flow.arcalot.io/pluginsdk
Apache License 2.0
0 stars 4 forks source link

Do not panic -- it's only a user error #86

Open webbnh opened 1 month ago

webbnh commented 1 month ago

Describe the bug

Per https://github.com/arcalot/arcaflow-plugin-sdk-go/pull/85#discussion_r1571171533, we should not be issuing a panic as a result of a user error. The error should be detected at an earlier point when it is reasonable to return an error to the user. A panic, aside from being ugly, is likely to be misconstrued by a user as a problem internal to Arca. We should instead be reporting an error as we would in other cases of a malformed workflow file.

jaredoconnell commented 1 month ago

For this task, we will need to add a recursive validation function to report errors before they're used.