From 2ff1200b2a90bdfe36465a06388966ce3f3f4c4e Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 8 Sep 2021 19:38:12 -0400 Subject: [PATCH] chore: migrate to owlbot (#665) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: migrate to owlbot * chore: fix typos * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix typos * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../example/errorreporting/QuickStart.java | 40 ++++++++++--------- .../example/errorreporting/QuickStartIT.java | 2 +- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/errorreporting/snippets/src/main/java/com/example/errorreporting/QuickStart.java b/errorreporting/snippets/src/main/java/com/example/errorreporting/QuickStart.java index b9032906131..819f564e183 100644 --- a/errorreporting/snippets/src/main/java/com/example/errorreporting/QuickStart.java +++ b/errorreporting/snippets/src/main/java/com/example/errorreporting/QuickStart.java @@ -29,12 +29,11 @@ /** * Snippet demonstrates using the Cloud Error Reporting API to report a custom error event. - *

- * This library is not required on App Engine, errors written to stderr are automatically written - * to Cloud Error Reporting. - * It is also not required if you are writing logs to Cloud Logging. - * Errors written to Cloud Logging that contain an exception or stack trace - * are automatically written out to Cloud Error Reporting. + * + *

This library is not required on App Engine, errors written to stderr are automatically written + * to Cloud Error Reporting. It is also not required if you are writing logs to Cloud Logging. + * Errors written to Cloud Logging that contain an exception or stack trace are automatically + * written out to Cloud Error Reporting. */ public class QuickStart { public static void main(String[] args) throws Exception { @@ -47,20 +46,23 @@ public static void main(String[] args) throws Exception { try (ReportErrorsServiceClient reportErrorsServiceClient = ReportErrorsServiceClient.create()) { // Custom error events require an error reporting location as well. - ErrorContext errorContext = ErrorContext.newBuilder() - .setReportLocation(SourceLocation.newBuilder() - .setFilePath("Test.java") - .setLineNumber(10) - .setFunctionName("myMethod") - .build()) - .build(); + ErrorContext errorContext = + ErrorContext.newBuilder() + .setReportLocation( + SourceLocation.newBuilder() + .setFilePath("Test.java") + .setLineNumber(10) + .setFunctionName("myMethod") + .build()) + .build(); - //Report a custom error event - ReportedErrorEvent customErrorEvent = ReportedErrorEvent.getDefaultInstance() - .toBuilder() - .setMessage("custom error event") - .setContext(errorContext) - .build(); + // Report a custom error event + ReportedErrorEvent customErrorEvent = + ReportedErrorEvent.getDefaultInstance() + .toBuilder() + .setMessage("custom error event") + .setContext(errorContext) + .build(); // Report an event synchronously, use .reportErrorEventCallable for asynchronous reporting. reportErrorsServiceClient.reportErrorEvent(projectName, customErrorEvent); } diff --git a/errorreporting/snippets/src/test/java/com/example/errorreporting/QuickStartIT.java b/errorreporting/snippets/src/test/java/com/example/errorreporting/QuickStartIT.java index 2c9e3099b46..6e7a47503b7 100644 --- a/errorreporting/snippets/src/test/java/com/example/errorreporting/QuickStartIT.java +++ b/errorreporting/snippets/src/test/java/com/example/errorreporting/QuickStartIT.java @@ -27,6 +27,6 @@ public class QuickStartIT { @Test public void testQuickStart() throws Exception { // Ensure quick start runs without any exception - QuickStart.main(new String[]{}); + QuickStart.main(new String[] {}); } }