Skip to content

Commit b7ad847

Browse files
authored
Merge pull request #117 from k-yomo/feature/fix_error_message
Include original error message to json parse error
2 parents 5016fd0 + 5f39254 commit b7ad847

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/embulk/output/bigquery.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def self.configure(config, schema, task_count)
135135
json_key = JSON.parse(task['json_keyfile'])
136136
task['project'] ||= json_key['project_id']
137137
rescue => e
138-
raise ConfigError.new "json_keyfile is not a JSON file"
138+
raise ConfigError.new "Parsing 'json_keyfile' failed with error: #{e.class} #{e.message}"
139139
end
140140
end
141141
if task['project'].nil?
@@ -166,7 +166,7 @@ def self.configure(config, schema, task_count)
166166
begin
167167
JSON.parse(File.read(task['schema_file']))
168168
rescue => e
169-
raise ConfigError.new "schema_file #{task['schema_file']} is not a JSON file"
169+
raise ConfigError.new "Parsing 'schema_file' #{task['schema_file']} failed with error: #{e.class} #{e.message}"
170170
end
171171
end
172172

0 commit comments

Comments
 (0)