File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- # [START error_reporting]
16
- from google .cloud import error_reporting
17
-
18
15
16
+ # [START error_reporting]
19
17
def simulate_error ():
18
+ from google .cloud import error_reporting
19
+
20
20
client = error_reporting .Client ()
21
21
try :
22
22
# simulate calling a method that's not defined
@@ -26,5 +26,15 @@ def simulate_error():
26
26
# [END error_reporting]
27
27
28
28
29
+ # [START error_reporting_manual]
30
+ def report_manual_error ():
31
+ from google .cloud import error_reporting
32
+
33
+ client = error_reporting .Client ()
34
+ client .report ("An error has occurred." )
35
+ # [END error_reporting_manual]
36
+
37
+
29
38
if __name__ == '__main__' :
30
39
simulate_error ()
40
+ report_manual_error ()
Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- import pytest
16
-
17
15
import report_exception
18
16
19
17
20
- @pytest .mark .xfail (
21
- strict = True ,
22
- reason = 'GoogleCloudPlatform/google-cloud-python#3263' )
23
18
def test_error_sends ():
24
19
report_exception .simulate_error ()
20
+
21
+
22
+ def test_manual_error_sends ():
23
+ report_exception .report_manual_error ()
You can’t perform that action at this time.
0 commit comments