Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unhandled errors #1350

Merged
merged 1 commit into from
Jul 15, 2024
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
1 change: 0 additions & 1 deletion internal/engines/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func NewCheckEngineWithCache(
schemaReader storage.SchemaReader,
cache cache.Cache,
) invoke.Check {

return &CheckEngineWithCache{
schemaReader: schemaReader,
checker: checker,
Expand Down
1 change: 0 additions & 1 deletion internal/invoke/invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func NewDirectInvoker(
lo Lookup,
sp SubjectPermission,
) *DirectInvoker {

return &DirectInvoker{
schemaReader: schemaReader,
dataReader: dataReader,
Expand Down
1 change: 0 additions & 1 deletion internal/servers/dataServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func NewDataServer(
br storage.BundleReader,
sr storage.SchemaReader,
) *DataServer {

return &DataServer{
dr: dr,
dw: dw,
Expand Down
1 change: 0 additions & 1 deletion internal/servers/schemaServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ type SchemaServer struct {

// NewSchemaServer - Creates new Schema Server
func NewSchemaServer(sw storage.SchemaWriter, sr storage.SchemaReader) *SchemaServer {

return &SchemaServer{
sw: sw,
sr: sr,
Expand Down
6 changes: 4 additions & 2 deletions internal/servers/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ import (
grpcV1 "github.com/Permify/permify/pkg/pb/base/v1"
)

var tracer = otel.Tracer("servers")
var meter = otel.Meter("servers")
var (
tracer = otel.Tracer("servers")
meter = otel.Meter("servers")
)

// Container is a struct that holds the invoker and various storage
// for permission-related operations. It serves as a central point of access
Expand Down
8 changes: 3 additions & 5 deletions pkg/telemetry/meter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package telemetry

import (
"context"
"fmt"
"log/slog"
"os"
"runtime"
"time"
Expand Down Expand Up @@ -72,9 +72,8 @@ func NewCounter(meter omt.Meter, name, description string) omt.Int64Counter {
name,
omt.WithDescription(description),
)

if err != nil {
fmt.Errorf("failed to create counter: %w", err)
slog.Error("failed to create counter: ", err)
panic(err)
}

Expand All @@ -87,9 +86,8 @@ func NewHistogram(meter omt.Meter, name, unit, description string) omt.Int64Hist
omt.WithUnit(unit),
omt.WithDescription(description),
)

if err != nil {
fmt.Errorf("failed to create histogram: %w", err)
slog.Error("failed to create histogram: ", err)
panic(err)
}

Expand Down
Loading