You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2011/11/29 14:44:59 UTC

[PATCH core 07/10] CIMI: Added standard exception to handle Entity not found errors

From: Michal Fojtik <mf...@redhat.com>


Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 server/lib/cimi/model/base.rb |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/server/lib/cimi/model/base.rb b/server/lib/cimi/model/base.rb
index 4fa9014..0088b8b 100644
--- a/server/lib/cimi/model/base.rb
+++ b/server/lib/cimi/model/base.rb
@@ -66,6 +66,15 @@ require 'json'
 #   [array(name, opts, &block)]
 #     An array of structured subobjects; the block defines the schema of
 #     the subobjects.
+
+class CIMI::Model::NotFound < StandardError
+  attr_accessor :code
+  def initialize
+    super("Requested Entity Not Found")
+    self.code = 404
+  end
+end
+
 class CIMI::Model::Base
 
   #
-- 
1.7.4.4