agrc / palletjack

A library for updating AGOL data from various external sources
MIT License
12 stars 0 forks source link

Get error message from AGOL #77

Open jacobdadams opened 7 months ago

jacobdadams commented 7 months ago

If we get an odd error 500, create something that grabs the token and job id and returns the error automatically rather than requiring the end user to do it manually.

steveoh commented 7 months ago

Will you elaborate on this a bit @stdavis or @jacobdadams since I'm unfamiliar with the issue? What error messages are we having trouble accessing? What actions are the job ids linked to? What is the manual process for getting the error message?

jacobdadams commented 7 months ago

Yeah, it's pretty well spelled out near the bottom of the readme

stdavis commented 7 months ago

It would be great if this was generic enough to be useable in other projects such as forklift.

jacobdadams commented 7 months ago

Agreed. Spitballing here, I wonder if writing it as a decorator makes sense. I'll look into that when I've got some prof dev time.

Also, again spitballing, I wonder if we could modify forklift to use the classes from palletjack for any AGOL work? Bring all our "foo to AGOL" workflows under one codebase?

jacobdadams commented 4 months ago

Thought: get token programmatically from arcgis.auth module

Or, apparently, you can get it from the gis object

crosner13 commented 4 months ago

Hey @jacobdadams, I was the one who was talking about grabbing a token from the GIS object today!

from arcgis.gis import GIS  
gis = GIS("https://www.arcgis.com", "your_username", "********")
token = gis._con.token
print(token)

This is how I will sometimes access the token via the GIS object. Alternatively, I'll access it with requests and a call to the REST API.

jacobdadams commented 4 months ago

Awesome, thanks Cole!

On Wed, Mar 13, 2024 at 10:00 PM Cole Rosner @.***> wrote:

Hey @jacobdadams https://github.com/jacobdadams, I was the one who was talking about grabbing a token from the GIS object today!

from arcgis.gis import GIS gis = GIS("https://www.arcgis.com", "your_username", "****") token = gis._con.token print(token)

This is how I will sometimes access the token via the GIS object. Alternatively, I'll access it with requests and a call to the REST API.

— Reply to this email directly, view it on GitHub https://github.com/agrc/palletjack/issues/77#issuecomment-1996354816, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJDGLXUSO4KQCYSR5MLTUZ3YYEOE3AVCNFSM6AAAAAA76EIFWCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJWGM2TIOBRGY . You are receiving this because you were mentioned.Message ID: @.***>