-
Notifications
You must be signed in to change notification settings - Fork 187
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
Fixed "See full error" on error toast #4119
Conversation
public/react-services/wz-request.ts
Outdated
* @returns error | ||
*/ | ||
static customErroMessage(error, message){ |
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.
issue: if the method is static
to the class, this is not accessible by the class instance.
suggestion: Use the class name instead of this
to use the method.
Explanation:
// Define a class
class MyClass{
// Constructor of the class instances
constructor(){
// Initialize the class instance. `this` keyword does reference to the class instance
}
// Define a static method for the class
static staticMethod(){
// This method is static of the class. This can't be accesed by the class instance.
// Use:
// MyClass.staticMethod();
}
// Define a method accesible by the class instance throught the prototype chain
methodAccesibleByTheClassInstance(){
// This method is in the prototype chain of the class instance, so this is accesible.
// Use:
// this.methodAccesibleByTheClassInstance();
}
}
nitpick: The method name has a typo Erro
instead of Error
.
thought: I am not sure that the proposed solution is good. It modified the thrown error in the As @Machi3mfl mentioned in this comment #4030 (comment) for the long term solution, we should adopt the same interface for the errors. This will need an analisys of the solution and the changes could break some things. My proposed solution is sure the parameter used by the service that displays the toast, has the expected interface, regardless if the error is a string or an object valid to use in the toast. With this solution, we secure the button should work with different error interfaces. |
|
Hi Team,
This PR resolves and error when user click on "See full error" button on error toast.
Closes #4030