From 1f3ea37ba800847ecc16b36c2747a281b9ab7d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Sch=C3=BCtz?= Date: Fri, 22 May 2015 13:08:44 +0200 Subject: [PATCH] Throw more appropriate std.conv.ConvException in BsonObjectID.fromHexString --- source/vibe/data/bson.d | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/vibe/data/bson.d b/source/vibe/data/bson.d index b49a107a71..77b8ce9c9a 100644 --- a/source/vibe/data/bson.d +++ b/source/vibe/data/bson.d @@ -575,7 +575,7 @@ struct Bson { entries ~= Bson(1); entries ~= Bson(true); entries ~= Bson("foo"); - + Bson value = Bson(entries); assert(value[0] == Bson(1)); assert(value[1] == Bson(true)); @@ -730,8 +730,9 @@ struct BsonObjectID { */ static BsonObjectID fromString(string str) { - static const lengthex = new Exception("BSON Object ID string must be 24 characters."); - static const charex = new Exception("Not a valid hex string."); + import std.conv : ConvException; + static const lengthex = new ConvException("BSON Object ID string must be 24 characters."); + static const charex = new ConvException("Not a valid hex string."); if (str.length != 24) throw lengthex; BsonObjectID ret = void;