Skip to content

Commit 7f4be92

Browse files
authored
chore: refactor error reporting code sample (GoogleCloudPlatform#1917)
1 parent f45f710 commit 7f4be92

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

error_reporting/quickstart.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

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

@@ -30,5 +30,5 @@
3030
Bootstrap::init($psrLogger);
3131

3232
print('Throwing a test exception. You can view the message at https://console.cloud.google.com/errors.' . PHP_EOL);
33-
throw new Exception('quickstart.php test exception');
33+
throw new Exception('Something went wrong');
3434
# [END error_reporting_quickstart]

error_reporting/test/quickstartTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ public function testQuickstart()
4949

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

0 commit comments

Comments
 (0)