Add parameters information to exceptions messages 48/234648/5
authorZofia Abramowska <z.abramowska@samsung.com>
Wed, 27 May 2020 15:48:17 +0000 (17:48 +0200)
committerZofia Abramowska <z.abramowska@samsung.com>
Thu, 9 Jul 2020 14:08:29 +0000 (16:08 +0200)
Fix UnknownPolicyTypeException and BucketNotExistsException

Change-Id: I3e4ef71e9050781d48d9537cf44111d1727bc37e

src/common/exceptions/BucketNotExistsException.h
src/common/exceptions/UnknownPolicyTypeException.h

index 68d041bf57a9dd102ad81bf0f60a32b8a29c78a0..c3c1ff477377d05f06b0b7b4878ee62aceed9b1f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2020 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -33,8 +33,10 @@ namespace Cynara {
 class BucketNotExistsException : public Exception {
 public:
     BucketNotExistsException() = delete;
-    BucketNotExistsException(const PolicyBucketId &bucketId)
-        : m_bucketId(bucketId), m_message("BucketNotExistsException") {
+    BucketNotExistsException(const PolicyBucketId &bucket)
+        : m_bucketId(bucket)
+    {
+        m_message = "Bucket " + bucketId() + " does not exist";
     }
     virtual ~BucketNotExistsException() {};
 
index 5ca10371f2f3cb9d5a1a70e0c11283e85091f4e0..701b39551182bedd7886e3b406e2ceb54c06d9d7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015-2020 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -33,8 +33,10 @@ namespace Cynara {
 class UnknownPolicyTypeException : public Exception {
 public:
     UnknownPolicyTypeException() = delete;
-    UnknownPolicyTypeException(const PolicyType &policyType)
-        : m_policyType(policyType), m_message("UnknownPolicyTypeException") {
+    UnknownPolicyTypeException(const PolicyType &p)
+        : m_policyType(p)
+    {
+        m_message = "Unknown PolicyType [" + std::to_string(policyType()) + "]";
     }
     virtual ~UnknownPolicyTypeException() {};