Skip to content

Commit dee8ebf

Browse files
committed
docs: describe onError
1 parent 2979990 commit dee8ebf

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ This callback is also called when Proof Point Details Modal is shown. This happe
206206

207207
You should pass your function to `onResized` prop. It should take the `height` argument and adjust your overlay component so that Bundle have enough space to display the content.
208208

209-
#### What if I need to add marging around the bundle?
209+
#### What if I need to add margin around the bundle?
210210

211211
Just add it to the `getBundleLoadingHeight` and `height` in `onResized` callback. Let's say you want to have more space between head of your BottomSheet and from the bottom of the screen. You could do something like:
212212

@@ -240,6 +240,24 @@ Just add it to the `getBundleLoadingHeight` and `height` in `onResized` callback
240240
/>
241241
```
242242

243+
#### Error handling
244+
245+
You may want to handle cases when HTTP request fails due to network issues or similar. For this you could register the `onError` callback when you call `configure`.
246+
247+
```
248+
import { configure } from "@provenance/react-native-provenance";
249+
250+
configure({
251+
apiKey: process.env.EXPO_PUBLIC_API_KEY,
252+
bundleId: process.env.EXPO_PUBLIC_BUNDLE_ID,
253+
onError: (error: string|Error) => {
254+
// your custom error handling logic here...
255+
// report it to you error tracking software
256+
// or hide the container components etc.
257+
}
258+
});
259+
```
260+
243261
## Contributing
244262

245263
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

0 commit comments

Comments
 (0)