-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
updated error handling sytem with unified way to show user error messeges #275
updated error handling sytem with unified way to show user error messeges #275
Conversation
…sege
@arkid15r Sir, I have created a complete error-handling system to display user error messages in a unified way. Please let me know if I have missed anything, made any mistakes, or if there are any changes or deletions needed |
…/github.com/nitinawari/Nest into error-handling-with-unified-error-messeging
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.
hiii @nitinawari can you update the code with latest test case changes
"@Rajgupta36, I’m facing issues with some test cases, all of which are related to a single functionality. Should I update the code without passing these test cases now? Could you help me resolve this issue?" |
Could you share more details about the specific issues you're facing? maybe i could help . |
Can you share the debugging logs? |
@Rajgupta36 there is nothing in dubug log just a retry increament count but i have this test failure |
@nitinawari ...should i suggest something ?....first ..please lets try to to add some console.log ststement and check how many times useErrorhandler instantiated and how many times the instance of ErrorService (btw naming is wrong inyour case) is getting created and calling handlerror function. |
as you have given maximum retry count as 3 ...i am quite sure its not 3 . If you get the count (actual ) and update the test case and then try to run it.I hope it can help |
i think here race condition happening now looking into that part also what is meant bu this |
@nitinawari i mean the file name is wrong right ..? exactly ..that what was i thinking ... You can try this : |
@yashpandey06 can you plz elaborate more. it is not a problem related to naming or instance it more like to retry attempt logic |
@arkid15r,
|
@arkid15r |
@Rajgupta36 ok i will use new york style and what about messege should i also update message |
no |
…r-messeging' into error-handling-with-unified-error-messeging
@arkid15r Sir, I have fixed the bugs as per your suggestions. This PR can be divided into two parts: ShadCN Integration and Configuration
Error Handling in the Frontend
|
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.
@nitinawari I'm going to review this PR, could you resolve the conflicts?
@nitinawari, could you please take a look at the requested changes . i added a shadcn config so you don't need this @ character for importing and exporting |
@arkid15r: Ready for review. I hope we can close this today. I have made the requested changes. If you find any bugs or need any improvements, I am happy to make the changes. I am available the whole day. |
looks good @nitinawari |
import type { ToastActionElement, ToastProps } from 'components/ui/Toast' | ||
|
||
const TOAST_LIMIT = 1 | ||
const TOAST_REMOVE_DELAY_SECOND = 10 //in seconds |
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.
This is too long and we should have different delays for success/warning/error messages.
import type { ToastActionElement, ToastProps } from 'components/ui/Toast' | ||
|
||
const TOAST_LIMIT = 1 | ||
const TOAST_REMOVE_DELAY_SECOND = 10 //in seconds |
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.
const TOAST_REMOVE_DELAY_SECOND = 10 //in seconds | |
const TOAST_REMOVE_DELAY_IN_SECONDS = 10 |
type Action = | ||
| { | ||
type: ActionType['ADD_TOAST'] | ||
toast: ToasterToast | ||
} | ||
| { | ||
type: ActionType['UPDATE_TOAST'] | ||
toast: Partial<ToasterToast> | ||
} | ||
| { | ||
type: ActionType['DISMISS_TOAST'] | ||
toastId?: ToasterToast['id'] | ||
} | ||
| { | ||
type: ActionType['REMOVE_TOAST'] | ||
toastId?: ToasterToast['id'] | ||
} |
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.
Could you explain this syntax to me?
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.
This functionality is useful for real-time updates to toasts but is not needed currently. For now, it has been disabled by removing the ActionType function, and it can be reintroduced later if required
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.
This still looks too big to me but now it's easier to understand.
A lot of work, thank you @nitinawari
I'll bump the estimated points for this task
Let's merge it 👍
@arkid15r Thank you for appreciating my work and increasing the points for this task! I'll continue to improve and refine it in the future. 😊 |
fixed #190
404 page