Skip to content

Commit

Permalink
chore: refactor error reporting code sample (#1917)
Browse files Browse the repository at this point in the history
  • Loading branch information
minherz authored Sep 21, 2023
1 parent f45f710 commit 7f4be92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions error_reporting/quickstart.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// These variables are set by the App Engine environment. To test locally,
// ensure these are set or manually change their values.
$projectId = getenv('GCLOUD_PROJECT') ?: 'YOUR_PROJECT_ID';
$projectId = getenv('GOOGLE_CLOUD_PROJECT') ?: 'YOUR_PROJECT_ID';
$service = getenv('GAE_SERVICE') ?: 'error_reporting_quickstart';
$version = getenv('GAE_VERSION') ?: 'test';

Expand All @@ -30,5 +30,5 @@
Bootstrap::init($psrLogger);

print('Throwing a test exception. You can view the message at https://console.cloud.google.com/errors.' . PHP_EOL);
throw new Exception('quickstart.php test exception');
throw new Exception('Something went wrong');
# [END error_reporting_quickstart]
2 changes: 1 addition & 1 deletion error_reporting/test/quickstartTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ public function testQuickstart()

// Make sure it worked
$this->assertStringContainsString('Throwing a test exception', $output);
$this->verifyReportedError(self::$projectId, 'quickstart.php test exception');
$this->verifyReportedError(self::$projectId, 'Something went wrong');
}
}

0 comments on commit 7f4be92

Please sign in to comment.