[merge] die on non-existent database

Summary: Die loudly if DB to merge is not accessible, before even getting to the Sqlite statement.

Reviewed By: skcho

Differential Revision: D28872539

fbshipit-source-id: af38edd9a
master
Nikos Gorogiannis 4 years ago committed by Facebook GitHub Bot
parent 990d0fbed5
commit e5b9d415f9

@ -147,6 +147,8 @@ module Implementation = struct
let merge_db infer_out_src =
let db_file = ResultsDirEntryName.get_path ~results_dir:infer_out_src CaptureDB in
if not (ISys.file_exists db_file) then
L.die InternalError "Tried to merge in DB at %s but path does not exist.@\n" db_file ;
let main_db = ResultsDatabase.get_database () in
SqliteUtils.exec main_db
~stmt:(Printf.sprintf "ATTACH '%s' AS attached" db_file)

Loading…
Cancel
Save