-
Notifications
You must be signed in to change notification settings - Fork 952
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Log as console . error so we get a log view and inform the user Reviewed By: lblasa Differential Revision: D50450794 fbshipit-source-id: 0eb1877eec4d602d6673dd2815af2692e89b2523
- Loading branch information
1 parent
cd46403
commit 05242b4
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
desktop/plugins/public/ui-debugger/plugin/traversalError.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
|
||
import {notification} from 'antd'; | ||
import {PluginClient} from 'flipper-plugin'; | ||
import {Events, Methods} from '../ClientTypes'; | ||
|
||
export function handleTraversalError(client: PluginClient<Events, Methods>) { | ||
client.onMessage('traversalError', (event) => { | ||
notification.warn({ | ||
key: 'client-traversal-error', | ||
duration: 60, | ||
message: 'Error fetching UI dump', | ||
description: `There was an error UI dump, ${event.errorType} ${event.errorMessage}. We are aware of this and looking into it. Please try again later.`, | ||
}); | ||
console.error( | ||
`[ui-debugger] Client error during traversal: `, | ||
event, | ||
client.appName, | ||
client.device.os, | ||
); | ||
}); | ||
} |