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

ENH: Error messages in failed scripts should be the job log #104

Open
patr1ckm opened this issue Mar 30, 2018 · 3 comments
Open

ENH: Error messages in failed scripts should be the job log #104

patr1ckm opened this issue Mar 30, 2018 · 3 comments

Comments

@patr1ckm
Copy link
Contributor

patr1ckm commented Mar 30, 2018

job <- scripts_post_r(name = "test", source = "stop('err')")
run <- scripts_post_r_runs(job$id)
await(scripts_get_r_runs, job$id, run$id)

Produces:

 Error: scripts_get_r_runs(id = 10602571, NA = 77083111): 

The object is:

scripts_get_r_runs(job$id, run$id)
<civis_api>
List of 7
 $ id               : int 77083111
 $ rId              : int 10602571
 $ state            : chr "failed"
 $ isCancelRequested: logi FALSE
 $ startedAt        : chr "2018-03-30T15:33:59.000Z"
 $ finishedAt       : chr "2018-03-30T15:34:37.000Z"
 $ error            : NULL
 - attr(*, "class")= chr [1:2] "civis_api" "list"
@patr1ckm patr1ckm added the bug label Mar 30, 2018
@keithing
Copy link
Contributor

@stephen-hoover confirmed that this field has only ever returned Platform errors. This means queries to Redshift will return a useful error, but user's code in container jobs has never returned this error field.

@patr1ckm patr1ckm added enhancement and removed bug labels Mar 30, 2018
@patr1ckm
Copy link
Contributor Author

Got it, I was definitely misunderstanding how this worked when I wrote the error handling in await.

I think the right thing to do is on an error to fetch the job log (whatever the job is) and surface the log as an error message to the user. I haven't tested, but I'm assuming this will work for queries as well.

@patr1ckm patr1ckm changed the title BUG: error strings no longer being returned in GET requests ENH: Error messages in failed scripts should be the job log Mar 30, 2018
@keithing
Copy link
Contributor

I think the right thing to do is on an error to fetch the job log (whatever the job is) and surface the log as an error message to the user.

If we can do that for a general case, that would be awesome.

I'm assuming this will work for queries as well

For queries we do get the error back in result[["error"]], so we should be okay there as well.

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

No branches or pull requests

2 participants