Reference documentation and code samples for the Stackdriver Error Reporting V1beta1 Client class ErrorContext.
A description of the context in which an error occurred.
This data should be provided by the application when reporting an error,
unless the
error report has been generated automatically from Google App Engine logs.
Generated from protobuf messagegoogle.devtools.clouderrorreporting.v1beta1.ErrorContext
The HTTP request which was processed when the error was triggered.
↳ user
string
The user who caused or was affected by the crash. This can be a user ID, an email address, or an arbitrary token that uniquely identifies the user. When sending an error report, leave this field empty if the user was not logged in. In this case the Error Reporting system will use other data, such as remote IP address, to distinguish affected users. Seeaffected_users_countinErrorGroupStats.
The location in the source code where the decision was made to report the error, usually the place where it was logged. For a logged exception this would be the source line where the exception is logged, usually close to the place where it was caught.
getHttpRequest
The HTTP request which was processed when the error was
triggered.
This can be a user ID, an email address, or an arbitrary token that
uniquely identifies the user.
When sending an error report, leave this field empty if the user was not
logged in. In this case the
Error Reporting system will use other data, such as remote IP address, to
distinguish affected users. Seeaffected_users_countinErrorGroupStats.
Returns
Type
Description
string
setUser
The user who caused or was affected by the crash.
This can be a user ID, an email address, or an arbitrary token that
uniquely identifies the user.
When sending an error report, leave this field empty if the user was not
logged in. In this case the
Error Reporting system will use other data, such as remote IP address, to
distinguish affected users. Seeaffected_users_countinErrorGroupStats.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getReportLocation
The location in the source code where the decision was made to
report the error, usually the place where it was logged.
For a logged exception this would be the source line where the
exception is logged, usually close to the place where it was
caught.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Stackdriver Error Reporting V1beta1 Client - Class ErrorContext (0.23.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.23.1 (latest)](/php/docs/reference/cloud-error-reporting/latest/V1beta1.ErrorContext)\n- [0.23.0](/php/docs/reference/cloud-error-reporting/0.23.0/V1beta1.ErrorContext)\n- [0.22.10](/php/docs/reference/cloud-error-reporting/0.22.10/V1beta1.ErrorContext)\n- [0.21.1](/php/docs/reference/cloud-error-reporting/0.21.1/V1beta1.ErrorContext)\n- [0.20.2](/php/docs/reference/cloud-error-reporting/0.20.2/V1beta1.ErrorContext)\n- [0.19.12](/php/docs/reference/cloud-error-reporting/0.19.12/V1beta1.ErrorContext) \n| **Beta**\n|\n|\n| This library is covered by the [Pre-GA Offerings Terms](/terms/service-terms#1)\n| of the Terms of Service. Pre-GA libraries might have limited support,\n| and changes to pre-GA libraries might not be compatible with other pre-GA versions.\n| For more information, see the\n[launch stage descriptions](/products#product-launch-stages). \nReference documentation and code samples for the Stackdriver Error Reporting V1beta1 Client class ErrorContext.\n\nA description of the context in which an error occurred.\n\nThis data should be provided by the application when reporting an error,\nunless the\nerror report has been generated automatically from Google App Engine logs.\n\nGenerated from protobuf message `google.devtools.clouderrorreporting.v1beta1.ErrorContext`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ ErrorReporting \\\\ V1beta1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getHttpRequest\n\nThe HTTP request which was processed when the error was\ntriggered.\n\n### hasHttpRequest\n\n### clearHttpRequest\n\n### setHttpRequest\n\nThe HTTP request which was processed when the error was\ntriggered.\n\n### getUser\n\nThe user who caused or was affected by the crash.\n\nThis can be a user ID, an email address, or an arbitrary token that\nuniquely identifies the user.\nWhen sending an error report, leave this field empty if the user was not\nlogged in. In this case the\nError Reporting system will use other data, such as remote IP address, to\ndistinguish affected users. See `affected_users_count` in\n`ErrorGroupStats`.\n\n### setUser\n\nThe user who caused or was affected by the crash.\n\nThis can be a user ID, an email address, or an arbitrary token that\nuniquely identifies the user.\nWhen sending an error report, leave this field empty if the user was not\nlogged in. In this case the\nError Reporting system will use other data, such as remote IP address, to\ndistinguish affected users. See `affected_users_count` in\n`ErrorGroupStats`.\n\n### getReportLocation\n\nThe location in the source code where the decision was made to\nreport the error, usually the place where it was logged.\n\nFor a logged exception this would be the source line where the\nexception is logged, usually close to the place where it was\ncaught.\n\n### hasReportLocation\n\n### clearReportLocation\n\n### setReportLocation\n\nThe location in the source code where the decision was made to\nreport the error, usually the place where it was logged.\n\nFor a logged exception this would be the source line where the\nexception is logged, usually close to the place where it was\ncaught."]]