-
Notifications
You must be signed in to change notification settings - Fork 27
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
Exit synadm early on fatal errors, refactor & fix query()
#168
base: master
Are you sure you want to change the base?
Conversation
query()
I guess check for anything that logs errors and exits. Searching for
Maybe do move it to some utils place (tying into the last point)
JSONs can also be strings, numbers, booleans, nulls, and the usually expected lists and dicts. In most (or even all) cases, it's dicts and possibly lists. So it can be kind of anything, but for specific API methods, we might as well just infer from the example output in Synapse Admin API docs, and for the query function, just JSON decoded I guess (noting that other types are possible too). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked at it, made some commits. Hope to get some feedback on some of my commits, if any.
- Add missing arguments. - Remove (types) since we have type hints now. - Reword here and there.
if these happen, it's pretty much a bug in our code, and so having the full stacktrace would help (if the user doesn't provide the command)
make it more clear
Co-authored-by: J0J0 Todos <[email protected]>
Co-authored-by: J0J0 Todos <[email protected]>
99f39c3
to
252d599
Compare
and don't overwrite built-in ConnectionError with import statement.
Good to go? @JacksonChen666 |
Ah moving to utils place......but actually: We don't have a place for it. I'd rather not invent one now. We do that if we ever need it elsewhere. Agreed? (we only have |
Addresses general error handling issues discussed in: #164
log_fatal_exit()
directly in this module as a regular function? Should it live insideApiRequest
? Or move it to a "utils-like" place? Will we use it outside this module too?resp.json()
returns lists or dicts. Or what doesjson string
mean in this context? It's no string in reality....