Reference documentation and code samples for the Stackdriver Error Reporting V1beta1 Client class SourceLocation.
Indicates a location in the source code of the service for which errors are
reported.functionNamemust be provided by the application when reporting
an error, unless the error report contains amessagewith a supported
exception stack trace. All fields are optional for the later case.
Generated from protobuf messagegoogle.devtools.clouderrorreporting.v1beta1.SourceLocation
Namespace
Google \ Cloud \ ErrorReporting \ V1beta1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ file_path
string
The source code filename, which can include a truncated relative path, or a full path from a production machine.
↳ line_number
int
1-based. 0 indicates that the line number is unknown.
↳ function_name
string
Human-readable name of a function or method. The value can include optional context like the class or package name. For example,my.package.MyClass.methodin case of Java.
getFilePath
The source code filename, which can include a truncated relative
path, or a full path from a production machine.
Returns
Type
Description
string
setFilePath
The source code filename, which can include a truncated relative
path, or a full path from a production machine.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getLineNumber
1-based. 0 indicates that the line number is unknown.
Returns
Type
Description
int
setLineNumber
1-based. 0 indicates that the line number is unknown.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getFunctionName
Human-readable name of a function or method.
The value can include optional context like the class or package name.
For example,my.package.MyClass.methodin case of Java.
Returns
Type
Description
string
setFunctionName
Human-readable name of a function or method.
The value can include optional context like the class or package name.
For example,my.package.MyClass.methodin case of Java.
[[["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 SourceLocation (0.23.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.23.1 (latest)](/php/docs/reference/cloud-error-reporting/latest/V1beta1.SourceLocation)\n- [0.23.0](/php/docs/reference/cloud-error-reporting/0.23.0/V1beta1.SourceLocation)\n- [0.22.10](/php/docs/reference/cloud-error-reporting/0.22.10/V1beta1.SourceLocation)\n- [0.21.1](/php/docs/reference/cloud-error-reporting/0.21.1/V1beta1.SourceLocation)\n- [0.20.2](/php/docs/reference/cloud-error-reporting/0.20.2/V1beta1.SourceLocation)\n- [0.19.12](/php/docs/reference/cloud-error-reporting/0.19.12/V1beta1.SourceLocation) \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 SourceLocation.\n\nIndicates a location in the source code of the service for which errors are\nreported. `functionName` must be provided by the application when reporting\nan error, unless the error report contains a `message` with a supported\nexception stack trace. All fields are optional for the later case.\n\nGenerated from protobuf message `google.devtools.clouderrorreporting.v1beta1.SourceLocation`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ ErrorReporting \\\\ V1beta1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getFilePath\n\nThe source code filename, which can include a truncated relative\npath, or a full path from a production machine.\n\n### setFilePath\n\nThe source code filename, which can include a truncated relative\npath, or a full path from a production machine.\n\n### getLineNumber\n\n1-based. 0 indicates that the line number is unknown.\n\n### setLineNumber\n\n1-based. 0 indicates that the line number is unknown.\n\n### getFunctionName\n\nHuman-readable name of a function or method.\n\nThe value can include optional context like the class or package name.\nFor example, `my.package.MyClass.method` in case of Java.\n\n### setFunctionName\n\nHuman-readable name of a function or method.\n\nThe value can include optional context like the class or package name.\nFor example, `my.package.MyClass.method` in case of Java."]]