Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Commit

Permalink
max_limit_on_data_read: update error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Nov 2, 2018
1 parent 0842809 commit cfe1d1e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@

## Trunk

* max_limit_on_data_read: update error msg
* src: simplify detection for more data
* lines: test empty line account for 1 line
* options: extract default options
Expand Down
2 changes: 1 addition & 1 deletion lib/es5/index.js
Expand Up @@ -762,7 +762,7 @@ Parser.prototype.__write = function (chars, end) {
}

if (!this._.commenting && ((ref3 = this._.field) != null ? ref3.length : void 0) > this.options.max_limit_on_data_read) {
return Error("Field exceeds max_limit_on_data_read setting (".concat(this.options.max_limit_on_data_read, ") ").concat(JSON.stringify(this.options.delimiter)));
return Error("Field exceeds max_limit_on_data_read: maximum value is ".concat(this.options.max_limit_on_data_read));
}

if (!this._.commenting && ((ref4 = this._.line) != null ? ref4.length : void 0) > this.options.max_limit_on_data_read) {
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/index.coffee.md
Expand Up @@ -452,7 +452,7 @@ Implementation of the [`stream.Transform` API](https://nodejs.org/api/stream.htm
else
i++
if not @_.commenting and @_.field?.length > @options.max_limit_on_data_read
return Error "Field exceeds max_limit_on_data_read setting (#{@options.max_limit_on_data_read}) #{JSON.stringify(@options.delimiter)}"
return Error "Field exceeds max_limit_on_data_read: maximum value is #{@options.max_limit_on_data_read}"
if not @_.commenting and @_.line?.length > @options.max_limit_on_data_read
return Error "Row delimiter not found in the file #{JSON.stringify(@options.rowDelimiter)}"
# Flush remaining fields and lines
Expand Down

0 comments on commit cfe1d1e

Please sign in to comment.