Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
Ignore error from react drag n drop (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarlow12 authored and wbreza committed Mar 9, 2019
1 parent 1e93507 commit 97ab5a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/react/components/common/errorHandler/errorHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ export class ErrorHandler extends React.Component<IErrorHandlerProps> {
* @param error The error to handle
*/
private handleError(error: string | Error | AppError) {
// This is a special case where we don't need to throw an
// exception. The error is thrown from within a few layers
// of components, so we don't have access to ReactDnD (drag and drop)
// directly. The action is performed correctly, so we
// don't need to display the error here
if (this.isReactDnDError(error)) {
return;
}
let appError: IAppError = null;
// Promise rejection with reason
if (typeof (error) === "string") {
Expand Down Expand Up @@ -137,4 +145,8 @@ export class ErrorHandler extends React.Component<IErrorHandlerProps> {
title: localizedError.title,
};
}

private isReactDnDError(e) {
return e.name === "Invariant Violation" && e.message === "Expected to find a valid target.";
}
}

0 comments on commit 97ab5a1

Please sign in to comment.