108108
109109MATCH_ENTRY_CONTENT = "%s/%s/*" % (XNAME_ENTRY , XNAME_CONTENT )
110110
111- class NoSuchUserException (Exception ):
112- """Thrown when a request is made to Splunk using a namespace that contains
113- a nonexistant user."""
114- pass
115-
116- class NoSuchApplicationException (Exception ):
117- """Thrown when a request is made to Splunk using a namespace that contains
118- a nonexistant application."""
119- pass
120-
121111class IllegalOperationException (Exception ):
122112 """Thrown when an operation is not possible on the Splunk instance that a
123113 :class:`Service` object is connected to."""
@@ -142,11 +132,6 @@ class InvalidNameException(Exception):
142132 in Splunk entity names."""
143133 pass
144134
145- class OperationFailedException (Exception ):
146- """Thrown when the requested operation resulted in an error in Splunk (and a
147- 400 HTTP return status)."""
148- pass
149-
150135class NoSuchCapability (Exception ):
151136 """Thrown when the capability that has been referred to doesn't exist."""
152137 pass
@@ -2403,13 +2388,7 @@ def oneshot(self, path, **kwargs):
24032388 available parameters, see `Input parameters <http://dev.splunk.com/view/SP-CAAAEE6#inputparams>`_ on Splunk Developer Portal.
24042389 :type kwargs: ``dict``
24052390 """
2406- try :
2407- self .post ('oneshot' , name = path , ** kwargs )
2408- except HTTPError as he :
2409- if he .status == 400 :
2410- raise OperationFailedException (str (he ))
2411- else :
2412- raise
2391+ self .post ('oneshot' , name = path , ** kwargs )
24132392
24142393
24152394class Job (Entity ):
@@ -2779,11 +2758,7 @@ def create(self, query, **kwargs):
27792758 """
27802759 if kwargs .get ("exec_mode" , None ) == "oneshot" :
27812760 raise TypeError ("Cannot specify exec_mode=oneshot; use the oneshot method instead." )
2782- try :
2783- response = self .post (search = query , ** kwargs )
2784- except HTTPError as he :
2785- if he .status == 400 : # Bad request. Raise a TypeError with the reason.
2786- raise TypeError (str (he ))
2761+ response = self .post (search = query , ** kwargs )
27872762 sid = _load_sid (response )
27882763 return Job (self .service , sid )
27892764
@@ -2820,13 +2795,7 @@ def export(self, query, **params):
28202795 """
28212796 if "exec_mode" in params :
28222797 raise TypeError ("Cannot specify an exec_mode to export." )
2823- try :
2824- return self .post (path_segment = "export" , search = query , ** params ).body
2825- except HTTPError as he :
2826- if he .status == 400 :
2827- raise ValueError (str (he ))
2828- else :
2829- raise
2798+ return self .post (path_segment = "export" , search = query , ** params ).body
28302799
28312800 def itemmeta (self ):
28322801 """There is no metadata available for class:``Jobs``.
@@ -2883,13 +2852,8 @@ def oneshot(self, query, **params):
28832852 """
28842853 if "exec_mode" in params :
28852854 raise TypeError ("Cannot specify an exec_mode to oneshot." )
2886- try :
2887- return self .post (search = query , exec_mode = "oneshot" , ** params ).body
2888- except HTTPError as he :
2889- if he .status == 400 :
2890- raise ValueError (str (he ))
2891- else :
2892- raise
2855+ return self .post (search = query , exec_mode = "oneshot" , ** params ).body
2856+
28932857
28942858class Loggers (Collection ):
28952859 """This class represents a collection of service logging categories.
0 commit comments