Skip to content

Commit 031a1fd

Browse files
authored
Convey proper logging practice in code sample (#157)
* Convey proper logging practice in code sample * Snap-in -> snap-in
1 parent ecf87b8 commit 031a1fd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

fern/docs/pages/retry-mechanism.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ The DevRev snap-ins platform offers event reliability features to ensure smooth
44

55
## Getting started
66

7-
To start using the event reliability features in your Snap-ins, follow these steps:
7+
To start using the event reliability features in your snap-ins, follow these steps:
88

99
1. Update your DevRev SDK to the latest version.
10-
2. Define retryable errors using the `FunctionExecutionError` interface in your Snap-in code.
10+
2. Define retryable errors using the `FunctionExecutionError` interface in your snap-in code.
1111
3. Configure the retry behavior in your snap-in manifest.
1212
4. Handle errors appropriately in your snap-in function.
1313

@@ -67,16 +67,18 @@ class FunctionExecutionError extends Error {
6767

6868
## Example usage
6969

70-
Here's an example of how to use the `FunctionExecutionError` in your Snap-in code:
70+
Here's an example of how to use the `FunctionExecutionError` in your snap-in code:
7171

7272
```typescript
7373
import { FunctionExecutionError } from '@devrev/typescript-sdk/dist/snap-ins/types';
7474
7575
export const run = async (events: any[]) => {
7676
/*
7777
Put your code here to handle the event.
78+
Note: Do not log the event payload here as it may contain sensitive information.
79+
Instead, explicitly log the fields you need.
7880
*/
79-
console.log('Events: ', JSON.stringify(events));
81+
console.log('Received an event');
8082
8183
try {
8284
// Your event processing logic here
@@ -104,4 +106,4 @@ export const run = async (events: any[]) => {
104106
export default run;
105107
```
106108

107-
In this example, the Snap-in function's `run` method processes the events and can throw a `FunctionExecutionError` to indicate whether the error is retryable or not. The Snap-in platform handles the error based on the `retry` and `refresh` properties set in the error object.
109+
In this example, the snap-in function's `run` method processes the events and can throw a `FunctionExecutionError` to indicate whether the error is retryable or not. The snap-in platform handles the error based on the `retry` and `refresh` properties set in the error object.

0 commit comments

Comments
 (0)