coddingtonbear / obsidian-local-rest-api

Unlock your automation needs by interacting with your notes in Obsidian over a secure REST API.
MIT License
607 stars 56 forks source link

Exceptions raised during request processing will not always be caught and returned as a 500 error #24

Closed coddingtonbear closed 2 years ago

coddingtonbear commented 2 years ago

An error report was received from @kaiiiz in #23:

I notice a related issue, for the PUT /vault/{filename} endpoint, if the specified folder in the path doesn't exist, the server will hang forever. (e.g. filename = c/d.md and folder c doesn't exist)

image

What I expected to get from the server response:

It should return 405 Bad Request or create the nested folder structure before creating the new file (maybe an optional parameter for this functionality?).

Originally posted by @kaiiiz in https://github.com/coddingtonbear/obsidian-local-rest-api/issues/23#issuecomment-1133943674

coddingtonbear commented 2 years ago

This was fixed (in that requests can no longer hang and will return a 500 error for unhandled errors) via 1f67f2cec0d1d8f42ef557053fa4508a38561dbb.