This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
Parse body message from http request #16
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
priority-2
Second highest priority, should be worked on as soon as the Priority-1 issues are finished
T1h
Time Estimate 1 Hour
At the moment we return the
http.post
body response directly on some of the Gitea function (ex:remote_create_repo
):gitea/lib/gitea.ex
Line 47 in 0c2bb0e
To make it easier for the application using Gitea we could parse the message of the body, or the status code and return either
{:ok, value}
or{:error, reason}
the
reason
could be an atom (:existing_repo
if we tried to create an existing repository) or we could create an Exception module and return this module. The idea is for the client application to be able to raise the exception.see: https://elixir-lang.org/getting-started/try-catch-and-rescue.html#errors
The text was updated successfully, but these errors were encountered: