From e5b9d415f9ce4f294fc2808658a1650672712dde Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Fri, 4 Jun 2021 02:21:53 -0700 Subject: [PATCH] [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 --- infer/src/base/DBWriter.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/infer/src/base/DBWriter.ml b/infer/src/base/DBWriter.ml index 29ff5a233..42b616945 100644 --- a/infer/src/base/DBWriter.ml +++ b/infer/src/base/DBWriter.ml @@ -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)