plane icon indicating copy to clipboard operation
plane copied to clipboard

[bug]: incorrect error when adding a link to a issue that doesnt start with http://|https://

Open elliots opened this issue 2 years ago • 1 comments

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:

image

Steps to reproduce

  1. Go to an issue
  2. Add a link with the url tel://123456

Browser

Mozilla Firefox

Version

Cloud

elliots avatar Jul 22 '23 22:07 elliots

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.

nareshNishad avatar Jul 24 '23 03:07 nareshNishad

PR #3147 fixes this issue

pushya22 avatar Feb 22 '24 07:02 pushya22