Replace sonar with flipper in docs

Summary: Replaces sonar with flipper in the docs of a website

Reviewed By: passy

Differential Revision: D9046564

fbshipit-source-id: 55d03d787489406571ea0b4ac0adbc0daaa95cd4
This commit is contained in:
Pritesh Nandgaonkar
2018-07-31 10:27:42 -07:00
committed by Pascal Hartig
parent 2128515a5d
commit 8db555b259
16 changed files with 56 additions and 56 deletions

View File

@@ -4,11 +4,11 @@ title: Error Handling
sidebar_label: Error Handling
---
Errors in Sonar plugins should be hidden from the user while providing actionable data to the plugin developer.
Errors in Flipper plugins should be hidden from the user while providing actionable data to the plugin developer.
## Android
To gracefully handle errors in Sonar we provide the `ErrorReportingRunnable` class. This is a custom runnable which catches all exceptions, stopping them from crashing the application and reporting them to the plugin developer.
To gracefully handle errors in Flipper we provide the `ErrorReportingRunnable` class. This is a custom runnable which catches all exceptions, stopping them from crashing the application and reporting them to the plugin developer.
```java
new ErrorReportingRunnable(mConnection) {
@@ -19,14 +19,14 @@ new ErrorReportingRunnable(mConnection) {
}.run();
```
Executing this block of code will always finish without error but may transfer any silences error to the Sonar desktop app. During plugin development these java stack traces are surfaced in the chrome dev console. In production the errors are instead sent to and a task is assigned so that you can quickly deploy a fix.
Executing this block of code will always finish without error but may transfer any silences error to the Flipper desktop app. During plugin development these java stack traces are surfaced in the chrome dev console. In production the errors are instead sent to and a task is assigned so that you can quickly deploy a fix.
Always use `ErrorReportingRunnable` for error handling instead of `try`/`catch` or even worse letting errors crash the app. With ErrorReportingRunnable you won't block anyone and you won't hide any stack traces.
## C++
To gracefully handle errors in Sonar we perform all transactions inside of a try block which catches all exceptions, stopping them from crashing the application and reporting them to the plugin developer. This includes your own customs implementations of `SonarPlugin::didConnect()` and `SonarConnection::send()` and `::receive()`!
To gracefully handle errors in Flipper we perform all transactions inside of a try block which catches all exceptions, stopping them from crashing the application and reporting them to the plugin developer. This includes your own customs implementations of `SonarPlugin::didConnect()` and `SonarConnection::send()` and `::receive()`!
That means you can safely throw exceptions in your plugin code. The exception messages will be sent to the Sonar desktop app. During plugin development the exception messages are surfaced in the Chrome dev console.
That means you can safely throw exceptions in your plugin code. The exception messages will be sent to the Flipper desktop app. During plugin development the exception messages are surfaced in the Chrome dev console.
If your plugin performs asynchronous work in which exceptions are thrown, these exceptions will not be caught by the Sonar infrastructure. You should handle them appropriately.
If your plugin performs asynchronous work in which exceptions are thrown, these exceptions will not be caught by the Flipper infrastructure. You should handle them appropriately.