Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (a *APIStore) PostTemplates(c *gin.Context) {

template, apiErr := a.buildTemplate(ctx, userID, team, templateID, body)
if apiErr != nil {
telemetry.ReportCriticalError(ctx, "error when requesting template build", apiErr.Err, telemetry.WithTemplateID(templateID))
telemetry.ReportErrorByCode(ctx, apiErr.Code, "error when requesting template build", apiErr.Err, telemetry.WithTemplateID(templateID))
a.sendAPIStoreError(c, apiErr.Code, apiErr.ClientMsg)

return
Expand Down Expand Up @@ -130,7 +130,7 @@ func (a *APIStore) PostTemplatesTemplateID(c *gin.Context, rawTemplateID api.Tem

template, apiErr := a.buildTemplate(ctx, userID, team, templateID, body)
if apiErr != nil {
telemetry.ReportCriticalError(ctx, "error when requesting template build", apiErr.Err, telemetry.WithTemplateID(templateID))
telemetry.ReportErrorByCode(ctx, apiErr.Code, "error when requesting template build", apiErr.Err, telemetry.WithTemplateID(templateID))
a.sendAPIStoreError(c, apiErr.Code, apiErr.ClientMsg)

return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func requestTemplateBuild(ctx context.Context, c *gin.Context, a *APIStore, body
template, apiError := template.RegisterBuild(ctx, a.templateCache, a.sqlcDB, buildReq)
if apiError != nil {
a.sendAPIStoreError(c, apiError.Code, apiError.ClientMsg)
telemetry.ReportCriticalError(ctx, "build template register failed", apiError.Err)
telemetry.ReportErrorByCode(ctx, apiError.Code, "error when requesting template build", apiError.Err, telemetry.WithTemplateID(templateID))

return nil
}
Expand Down
4 changes: 0 additions & 4 deletions packages/api/internal/template/register_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ func RegisterBuild(

cpuCount, ramMB, apiError := team.LimitResources(data.Team.Limits, data.CpuCount, data.MemoryMB)
if apiError != nil {
telemetry.ReportCriticalError(ctx, "error when getting CPU and RAM", apiError.Err)

return nil, apiError
}

Comment thread
jakubno marked this conversation as resolved.
Expand Down Expand Up @@ -257,7 +255,6 @@ func RegisterBuild(

if exists {
err := fmt.Errorf("alias '%s' is already used", alias)
telemetry.ReportCriticalError(ctx, "conflict of alias", err, attribute.String("alias", alias))

return nil, &api.APIError{
Err: err,
Expand Down Expand Up @@ -319,7 +316,6 @@ func RegisterBuild(
telemetry.ReportEvent(ctx, "created new alias", attribute.String("env.alias", alias))
} else if aliasDB.EnvID != data.TemplateID {
err := fmt.Errorf("alias '%s' already used", alias)
telemetry.ReportCriticalError(ctx, "alias already used", err, attribute.String("alias", alias))

return nil, &api.APIError{
Err: err,
Expand Down
Loading