Skip to content

Commit d5cfe17

Browse files
committed
docs: Clarify when to catch
1 parent 0424557 commit d5cfe17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ const ipinfo = await ipinfoWrapper.lookupIp("1.1.1.1");
4444
#### Best practices
4545

4646
Each `lookup` method will throw an error when the lookup does not complete
47-
successfully. A program that performs a lookup should catch errors and return
48-
a default value. For example, if your program is performing a lookup to find the
49-
country code of an IP:
47+
successfully. A program that performs a lookup should catch errors unless it is
48+
desirable for the error to bubble up. For example, if your program is performing
49+
a lookup to find the country code of an IP:
5050

5151
```typescript
5252
const ipinfo = await ipinfoWrapper.lookupIp("1.1.1.1").catch(error => null);

0 commit comments

Comments
 (0)