Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluxion go bindings: better error message passing #1128

Open
vsoch opened this issue Dec 22, 2023 · 3 comments
Open

Fluxion go bindings: better error message passing #1128

vsoch opened this issue Dec 22, 2023 · 3 comments

Comments

@vsoch
Copy link
Member

vsoch commented Dec 22, 2023

When our current PRs are merged, I'd like to do a PR to make changes similar to here. Basically, when we are developing with the flux go bindings, an error message might look like the following:

Adding node for arm
    Generation: 0
        Vendor: generic
 Match policy: first
 Load format: JSON Graph Format (JGF)
Error creating context: issue initializing resource api client -1

We get a generic message "error creating context" and the return code, which isn't helpful. The developer here could make a call to cli.GetErrMsg(), but the issue is that if the developer is, for example, not touching the code but instead working on some json graph, they will have no clue what is wrong. When I add a simple tweak to my test branch to retrieve the message (given nonzero) I am passed forward the message:

 Load format: JSON Graph Format (JGF)
Error creating context: issue initializing resource api client:reapi_cli_initialize: Runtime error: resource_query_t: ERROR: fill_fetcher: malformed metadata in an JGF node for 0

ERROR: error generating resources

Ah yes, my malformed metadata! Of course! So when #1120 is merged I'd like to follow up with a PR to do this small change, and I'd also propose renaming the GetErrMsg() to be fully written out (mostly for consistency in our naming) and I'll make sure to fix all the places in other projects that function is used.

@vsoch
Copy link
Member Author

vsoch commented May 3, 2024

I want to ping again on this issue (because I'm hitting it again). Even when I call cli.GetErrMsg() the error message isn't great to tell me what is wrong:

image

I suspect it's the same or a similar issue as before (I'm converting JGF v2 back to v1 for flux) but probably if we give this API a look a more meaningful message to the developer user would be really helpful.

@vsoch
Copy link
Member Author

vsoch commented May 3, 2024

lol my matcher is localhost... HOLD THE PHONE! ☎️

@vsoch
Copy link
Member Author

vsoch commented May 3, 2024

😆

image
image

Note to self: when copy pasting a string flag, make sure to change the default from the previous string flag...

Why yes, operator, I know my neurons are going to sleep and so should I. What's that? This banana and my hand are not telephones? Says who!

slams telephone

ouch. 🤕

Yes, banana phone 🍌 I do believe it is time we went to sleep. Why am I talking to you? Why are you talking to me, you're a banana?

narrator voice @vsoch does not talk to inanimate objects, mostly herself, and likes making very bad jokes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant