Skip to content

Commit 40cd6b7

Browse files
authored
Improve README.md by introducing ErrorReportConfiguration (#1095)
1 parent 9d9972a commit 40cd6b7

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ An example can be found from [Reading and Writing Event Streams](http://www.cowt
106106

107107
## Processing limits
108108

109-
Starting with [Jackson 2.15](https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.15) Jackson has configurable limits for some aspects of input decoding and output generation.
109+
Starting with [Jackson 2.15](https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.15), Jackson has configurable limits for some aspects of input decoding and output generation.
110110

111111
Implemented limits are:
112112

@@ -135,11 +135,34 @@ Implemented limits are:
135135

136136
You can change per-factory limits as follows:
137137

138+
```java
139+
JsonFactory f = JsonFactory.builder()
140+
.streamReadConstraints(StreamReadConstraints.builder().maxNumberLength(250).build())
141+
.streamWriteConstraints(StreamWriteConstraints.builder().maxNestingDepth(2000).build())
142+
.build();
138143
```
144+
145+
## Error Report Configuration
146+
147+
Starting with [Jackson 2.16](https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.16), Jackson offers configurable
148+
behavior around error-reporting.
149+
150+
Currently supported configuration options are:
151+
152+
- `maxErrorTokenLength` : Maximum length of token to include in error messages (2.16+): (see [#1066](https://github.com/FasterXML/jackson-core/issues/1066))
153+
- `maxRawContentLength` : Maximum length of raw content to include in error messages (2.16+): (see [#1066](https://github.com/FasterXML/jackson-core/issues/1066))
154+
155+
... see [Example](#example) section below.
156+
157+
### Example
158+
159+
```java
139160
JsonFactory f = JsonFactory.builder()
140-
.streamReadConstraints(StreamReadConstraints.builder().maxNumberLength(250).build())
141-
.streamWriteConstraints(StreamWriteConstraints.builder().maxNestingDepth(2000).build())
142-
.build();
161+
.errorReportConfiguration(ErrorReportConfiguration.builder()
162+
.maxErrorTokenLength(1004)
163+
.maxRawContentLength(2008)
164+
.build()
165+
).build();
143166
```
144167

145168
-----

0 commit comments

Comments
 (0)