lib/niceql.rb in niceql-0.1.11 vs lib/niceql.rb in niceql-0.1.12
- old
+ new
@@ -50,9 +50,10 @@
prettify_pg_err( err.to_s )
end
def self.prettify_pg_err(err)
+ return err if err[/LINE \d+/].nil?
err_line_num = err[/LINE \d+/][5..-1].to_i
start_sql_line = err.lines[3][/(HINT|DETAIL)/] ? 4 : 3
err_body = err.lines[start_sql_line..-1]
err_quote = ( err.lines[1][/\.\.\..+\.\.\./] && err.lines[1][/\.\.\..+\.\.\./][3..-4] ) ||