[bug]: incorrect error when adding a link to a issue that doesnt start with http://|https://
Is there an existing issue for this?
- [X] I have searched the existing issues
Current behavior
When I try to add a link to my test issue that doesnt start with http:// or https://, it says:
Steps to reproduce
- Go to an issue
- Add a link with the url tel://123456
Browser
Mozilla Firefox
Version
Cloud
I reviewed the raised issue, and I've noticed the problem lies in how error codes are handled and the inconsistency in backend error responses. The code at https://github.com/makeplane/plane/blob/fe6077194364c4ae1483d65b9dba6fc9b9a62424/apps/app/components/issues/sidebar.tsx#L134 throws the same error for all 400 status codes, which can be challenging for frontend developers to handle effectively. Moreover, the backend error response format, such as {"url":["Enter a valid URL."]}, lacks standardization, leading to potential confusion in displaying error messages on the frontend.
PR #3147 fixes this issue