Skip to content
Snippets Groups Projects
Commit 64a6a0d5 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add more detail to the file open failure exception

parent f8ec728d
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ function RecordFile(filename, definition)
this.RecordLength=getRecordLength(this.fields);
// A vbuf of a record length prevents more than one record from being in the buffer.
if(!this.file.open(file_exists(this.file.name)?"rb+":"wb+",true,this.RecordLength)) {
throw new Error("Failed to open file "+this.file.name);
throw new Error(format("%d (%s) opening '%s'", this.file.error, strerror(this.file.error), this.file.name));
}
Object.defineProperty(this, 'length', {
enumerable: true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment