feat(chalice): handle unreachable sourcemap reader
This commit is contained in:
parent
ec966902e3
commit
46dcd82558
1 changed files with 11 additions and 4 deletions
|
|
@ -14,8 +14,15 @@ def get_original_trace(key, positions):
|
|||
"S3_SECRET": config('S3_SECRET'),
|
||||
"region": config('sessions_region')
|
||||
}
|
||||
r = requests.post(config("sourcemaps_reader"), json=payload)
|
||||
if r.status_code != 200:
|
||||
try:
|
||||
r = requests.post(config("sourcemaps_reader"), json=payload,
|
||||
timeout=config("sourcemapTimeout", cast=int, default=5))
|
||||
if r.status_code != 200:
|
||||
return {}
|
||||
return r.json()
|
||||
except requests.exceptions.Timeout:
|
||||
print("Timeout getting sourcemap")
|
||||
return {}
|
||||
except Exception as e:
|
||||
print("issue getting sourcemap")
|
||||
return {}
|
||||
|
||||
return r.json()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue