From ac61ae0a644774ff95546f83afece22d45e46fb0 Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Mon, 14 Aug 2023 22:48:44 +0200 Subject: [PATCH] add error logging on DB errors keep quiet when it's just package not found, but otherwise log error This will introduce logs for when DB requests fail, as well as when deserialization fails for some reason. --- source/dubregistry/registry.d | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/dubregistry/registry.d b/source/dubregistry/registry.d index 89db93e3..a3affff1 100644 --- a/source/dubregistry/registry.d +++ b/source/dubregistry/registry.d @@ -219,7 +219,11 @@ class DubRegistry { { DbPackage pack; try pack = m_db.getPackage(packname); - catch(Exception) return PackageInfo.init; + catch (RecordNotFound) return PackageInfo.init; + catch (Exception e) { + logError("Unexpected Exception when calling db.getPackage: %s", (() @trusted => e.toString())()); + return PackageInfo.init; + } return getPackageInfo(pack, flags); }