# Errors ## ReportErrors `client.Errors.ReportErrors(ctx, body) (*ErrorReportErrorsResponse, error)` **post** `/gitpod.v1.ErrorsService/ReportErrors` ReportErrors allows clients to report batches of errors that will be sent to error reporting systems. The structure is fully compatible with Sentry's event payload format. Use this method to: - Report client-side errors and exceptions - Track application crashes and panics - Send error context and metadata for debugging ### Examples - Report a JavaScript error with Sentry-compatible structure: The service accepts events with comprehensive error information including stack traces, identity context, breadcrumbs, and metadata that align with Sentry's event payload format. ### Parameters - `body ErrorReportErrorsParams` - `Events param.Field[[]ErrorEvent]` Error events to be reported (batch) - now using Sentry-compatible structure - `Breadcrumbs []Breadcrumb` Breadcrumbs leading up to the error - `Category string` Breadcrumb category - `Data map[string, string]` Additional breadcrumb data - `Level ErrorLevel` Breadcrumb level - `const ErrorLevelUnspecified ErrorLevel = "ERROR_LEVEL_UNSPECIFIED"` - `const ErrorLevelDebug ErrorLevel = "ERROR_LEVEL_DEBUG"` - `const ErrorLevelInfo ErrorLevel = "ERROR_LEVEL_INFO"` - `const ErrorLevelWarning ErrorLevel = "ERROR_LEVEL_WARNING"` - `const ErrorLevelError ErrorLevel = "ERROR_LEVEL_ERROR"` - `const ErrorLevelFatal ErrorLevel = "ERROR_LEVEL_FATAL"` - `Message string` Breadcrumb message - `Timestamp Time` When the breadcrumb occurred - `Type string` Breadcrumb type (e.g., "navigation", "http", "user", "error") - `Environment string` Environment (e.g., "production", "staging", "development") - `EventID string` Unique event identifier (required by Sentry) - `Exceptions []ExceptionInfo` Exception information (primary error data) - `Mechanism ExceptionMechanism` Exception mechanism - `Data map[string, string]` Additional mechanism-specific data - `Description string` Human-readable description of the mechanism - `Handled bool` Whether the exception was handled by user code - `Synthetic bool` Whether this is a synthetic exception (created by SDK) - `Type string` Type of mechanism (e.g., "generic", "promise", "onerror") - `Module string` Module or package where the exception type is defined - `Stacktrace []StackFrame` Stack trace frames - `Colno int64` Column number in the line - `ContextLine string` - `Filename string` File name or path - `Function string` Function name - `InApp bool` Whether this frame is in application code (vs library/framework code) - `Lineno int64` Line number in the file - `Module string` Module or package name - `PostContext []string` - `PreContext []string` Source code context around the error line - `Vars map[string, string]` Additional frame-specific variables/locals - `ThreadID string` Thread ID if applicable - `Type string` Exception type/class name - `Value string` Exception message/value - `Extra map[string, string]` Additional arbitrary metadata - `Fingerprint []string` Custom fingerprint for grouping - `IdentityID string` Identity ID of the user (UUID) - `Level ErrorLevel` Error severity level - `Logger string` Logger name - `Modules map[string, string]` Modules/dependencies information - `Platform string` Platform identifier (required by Sentry) - `Release string` Release version - `Request RequestInfo` Request information - `Data string` Request body (truncated if large) - `Headers map[string, string]` Request headers - `Method string` HTTP method - `QueryString map[string, string]` Query parameters - `URL string` Request URL - `SDK map[string, string]` SDK information - `ServerName string` Server/host name - `Tags map[string, string]` Tags for filtering and grouping - `Timestamp Time` When the event occurred (required by Sentry) - `Transaction string` Transaction name (e.g., route name, function name) ### Returns - `type ErrorReportErrorsResponse interface{…}` ReportErrorsResponse confirms that the errors were successfully received Success is indicated by HTTP 200 status code, failures by other status codes Empty response - success indicated by HTTP status code ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Errors.ReportErrors(context.TODO(), gitpod.ErrorReportErrorsParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json {} ``` ## Domain Types ### Breadcrumb - `type Breadcrumb struct{…}` Breadcrumb information (Sentry-compatible) - `Category string` Breadcrumb category - `Data map[string, string]` Additional breadcrumb data - `Level ErrorLevel` Breadcrumb level - `const ErrorLevelUnspecified ErrorLevel = "ERROR_LEVEL_UNSPECIFIED"` - `const ErrorLevelDebug ErrorLevel = "ERROR_LEVEL_DEBUG"` - `const ErrorLevelInfo ErrorLevel = "ERROR_LEVEL_INFO"` - `const ErrorLevelWarning ErrorLevel = "ERROR_LEVEL_WARNING"` - `const ErrorLevelError ErrorLevel = "ERROR_LEVEL_ERROR"` - `const ErrorLevelFatal ErrorLevel = "ERROR_LEVEL_FATAL"` - `Message string` Breadcrumb message - `Timestamp Time` When the breadcrumb occurred - `Type string` Breadcrumb type (e.g., "navigation", "http", "user", "error") ### Error Event - `type ErrorEvent struct{…}` ErrorEvent contains comprehensive error information (Sentry-compatible) - `Breadcrumbs []Breadcrumb` Breadcrumbs leading up to the error - `Category string` Breadcrumb category - `Data map[string, string]` Additional breadcrumb data - `Level ErrorLevel` Breadcrumb level - `const ErrorLevelUnspecified ErrorLevel = "ERROR_LEVEL_UNSPECIFIED"` - `const ErrorLevelDebug ErrorLevel = "ERROR_LEVEL_DEBUG"` - `const ErrorLevelInfo ErrorLevel = "ERROR_LEVEL_INFO"` - `const ErrorLevelWarning ErrorLevel = "ERROR_LEVEL_WARNING"` - `const ErrorLevelError ErrorLevel = "ERROR_LEVEL_ERROR"` - `const ErrorLevelFatal ErrorLevel = "ERROR_LEVEL_FATAL"` - `Message string` Breadcrumb message - `Timestamp Time` When the breadcrumb occurred - `Type string` Breadcrumb type (e.g., "navigation", "http", "user", "error") - `Environment string` Environment (e.g., "production", "staging", "development") - `EventID string` Unique event identifier (required by Sentry) - `Exceptions []ExceptionInfo` Exception information (primary error data) - `Mechanism ExceptionMechanism` Exception mechanism - `Data map[string, string]` Additional mechanism-specific data - `Description string` Human-readable description of the mechanism - `Handled bool` Whether the exception was handled by user code - `Synthetic bool` Whether this is a synthetic exception (created by SDK) - `Type string` Type of mechanism (e.g., "generic", "promise", "onerror") - `Module string` Module or package where the exception type is defined - `Stacktrace []StackFrame` Stack trace frames - `Colno int64` Column number in the line - `ContextLine string` - `Filename string` File name or path - `Function string` Function name - `InApp bool` Whether this frame is in application code (vs library/framework code) - `Lineno int64` Line number in the file - `Module string` Module or package name - `PostContext []string` - `PreContext []string` Source code context around the error line - `Vars map[string, string]` Additional frame-specific variables/locals - `ThreadID string` Thread ID if applicable - `Type string` Exception type/class name - `Value string` Exception message/value - `Extra map[string, string]` Additional arbitrary metadata - `Fingerprint []string` Custom fingerprint for grouping - `IdentityID string` Identity ID of the user (UUID) - `Level ErrorLevel` Error severity level - `Logger string` Logger name - `Modules map[string, string]` Modules/dependencies information - `Platform string` Platform identifier (required by Sentry) - `Release string` Release version - `Request RequestInfo` Request information - `Data string` Request body (truncated if large) - `Headers map[string, string]` Request headers - `Method string` HTTP method - `QueryString map[string, string]` Query parameters - `URL string` Request URL - `SDK map[string, string]` SDK information - `ServerName string` Server/host name - `Tags map[string, string]` Tags for filtering and grouping - `Timestamp Time` When the event occurred (required by Sentry) - `Transaction string` Transaction name (e.g., route name, function name) ### Error Level - `type ErrorLevel string` Error severity levels (aligned with Sentry levels) - `const ErrorLevelUnspecified ErrorLevel = "ERROR_LEVEL_UNSPECIFIED"` - `const ErrorLevelDebug ErrorLevel = "ERROR_LEVEL_DEBUG"` - `const ErrorLevelInfo ErrorLevel = "ERROR_LEVEL_INFO"` - `const ErrorLevelWarning ErrorLevel = "ERROR_LEVEL_WARNING"` - `const ErrorLevelError ErrorLevel = "ERROR_LEVEL_ERROR"` - `const ErrorLevelFatal ErrorLevel = "ERROR_LEVEL_FATAL"` ### Exception Info - `type ExceptionInfo struct{…}` Exception information (Sentry-compatible) - `Mechanism ExceptionMechanism` Exception mechanism - `Data map[string, string]` Additional mechanism-specific data - `Description string` Human-readable description of the mechanism - `Handled bool` Whether the exception was handled by user code - `Synthetic bool` Whether this is a synthetic exception (created by SDK) - `Type string` Type of mechanism (e.g., "generic", "promise", "onerror") - `Module string` Module or package where the exception type is defined - `Stacktrace []StackFrame` Stack trace frames - `Colno int64` Column number in the line - `ContextLine string` - `Filename string` File name or path - `Function string` Function name - `InApp bool` Whether this frame is in application code (vs library/framework code) - `Lineno int64` Line number in the file - `Module string` Module or package name - `PostContext []string` - `PreContext []string` Source code context around the error line - `Vars map[string, string]` Additional frame-specific variables/locals - `ThreadID string` Thread ID if applicable - `Type string` Exception type/class name - `Value string` Exception message/value ### Exception Mechanism - `type ExceptionMechanism struct{…}` Exception mechanism information (Sentry-compatible) - `Data map[string, string]` Additional mechanism-specific data - `Description string` Human-readable description of the mechanism - `Handled bool` Whether the exception was handled by user code - `Synthetic bool` Whether this is a synthetic exception (created by SDK) - `Type string` Type of mechanism (e.g., "generic", "promise", "onerror") ### Request Info - `type RequestInfo struct{…}` Request information (Sentry-compatible) - `Data string` Request body (truncated if large) - `Headers map[string, string]` Request headers - `Method string` HTTP method - `QueryString map[string, string]` Query parameters - `URL string` Request URL ### Stack Frame - `type StackFrame struct{…}` Stack trace frame information (Sentry-compatible) - `Colno int64` Column number in the line - `ContextLine string` - `Filename string` File name or path - `Function string` Function name - `InApp bool` Whether this frame is in application code (vs library/framework code) - `Lineno int64` Line number in the file - `Module string` Module or package name - `PostContext []string` - `PreContext []string` Source code context around the error line - `Vars map[string, string]` Additional frame-specific variables/locals