diff --git a/pkg/models/block.go b/pkg/models/block.go index 0fe38c2..d9581f3 100644 --- a/pkg/models/block.go +++ b/pkg/models/block.go @@ -41,7 +41,7 @@ var _ pg.QueryHook = (*Block)(nil) func (*Block) BeforeQuery(ctx context.Context, event *pg.QueryEvent) (context.Context, error) { query, err := event.FormattedQuery() if err != nil { - return ctx, nil + return ctx, err } klog.V(5).Infof("[format query] %s\n", string(query)) return ctx, nil diff --git a/pkg/models/transaction.go b/pkg/models/transaction.go index 0f918c7..cf43d7a 100644 --- a/pkg/models/transaction.go +++ b/pkg/models/transaction.go @@ -56,7 +56,7 @@ var _ pg.QueryHook = (*Transaction)(nil) func (*Transaction) BeforeQuery(ctx context.Context, event *pg.QueryEvent) (context.Context, error) { query, err := event.FormattedQuery() if err != nil { - return ctx, nil + return ctx, err } klog.V(5).Infof("[format query] %s\n", string(query)) return ctx, nil diff --git a/pkg/viewer/viewer.go b/pkg/viewer/viewer.go index cd5d9e3..2ab65bc 100644 --- a/pkg/viewer/viewer.go +++ b/pkg/viewer/viewer.go @@ -168,7 +168,7 @@ func (h *handler) CountTransactionsCreatedByOrg(ctx *fiber.Ctx) error { ctx.Status(http.StatusInternalServerError) if pg.ErrNoRows == err { ctx.Status(http.StatusNotFound) - msg = fmt.Sprintf("no transactions found") + msg = "no transactions found" } return ctx.JSON(map[string]string{"msg": msg}) }