Skip to content

Commit

Permalink
Log error
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrvivian committed Sep 8, 2023
1 parent 603835e commit 549d9ca
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions components/mqtt/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func (s *Server) publishLatestCommitmentTopic() {
s.LogDebug("publishLatestCommitmentTopic")
latest, err := s.NodeBridge.LatestCommitment()
if err != nil {
s.LogError("failed to retrieve latest commitment")
s.LogErrorf("failed to retrieve latest commitment: %v", err)
return

Check failure on line 418 in components/mqtt/server.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/mqtt/server.go#L418

return with no blank line before (nlreturn)
Raw output
components/mqtt/server.go:418:3: return with no blank line before (nlreturn)
		return
		^
}

Expand All @@ -425,13 +425,13 @@ func (s *Server) publishLatestCommitmentInfoTopic() {
s.LogDebug("publishLatestCommitmentInfoTopic")
latest, err := s.NodeBridge.LatestCommitment()
if err != nil {
s.LogError("failed to retrieve latest commitment")
s.LogErrorf("failed to retrieve latest commitment: %v", err)
return

Check failure on line 429 in components/mqtt/server.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/mqtt/server.go#L429

return with no blank line before (nlreturn)
Raw output
components/mqtt/server.go:429:3: return with no blank line before (nlreturn)
		return
		^
}

id, err := latest.ID()
if err != nil {
s.LogError("failed to retrieve latest commitment")
s.LogErrorf("failed to retrieve latest commitment: %v", err)
return

Check failure on line 435 in components/mqtt/server.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/mqtt/server.go#L435

return with no blank line before (nlreturn)
Raw output
components/mqtt/server.go:435:3: return with no blank line before (nlreturn)
		return
		^
}

Expand All @@ -445,13 +445,13 @@ func (s *Server) publishFinalizedCommitmentInfoTopic() {
s.LogDebug("publishFinalizedCommitmentInfoTopic")
finalized, err := s.NodeBridge.LatestFinalizedCommitment()
if err != nil {
s.LogError("failed to retrieve latest commitment")
s.LogErrorf("failed to retrieve latest commitment: %v", err)
return

Check failure on line 449 in components/mqtt/server.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/mqtt/server.go#L449

return with no blank line before (nlreturn)
Raw output
components/mqtt/server.go:449:3: return with no blank line before (nlreturn)
		return
		^
}

id, err := finalized.ID()
if err != nil {
s.LogError("failed to retrieve latest finalized commitment")
s.LogErrorf("failed to retrieve latest finalized commitment: %v", err)
return

Check failure on line 455 in components/mqtt/server.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/mqtt/server.go#L455

return with no blank line before (nlreturn)
Raw output
components/mqtt/server.go:455:3: return with no blank line before (nlreturn)
		return
		^
}

Expand All @@ -462,6 +462,7 @@ func (s *Server) fetchAndPublishBlockMetadata(ctx context.Context, blockID iotag
s.LogDebugf("fetchAndPublishBlockMetadata: %s", blockID.ToHex())
resp, err := s.NodeBridge.Client().ReadBlockMetadata(ctx, inx.NewBlockId(blockID))
if err != nil {
s.LogErrorf("failed to retrieve block metadata %s: %v", blockID.ToHex(), err)
return

Check failure on line 466 in components/mqtt/server.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/mqtt/server.go#L466

return with no blank line before (nlreturn)
Raw output
components/mqtt/server.go:466:3: return with no blank line before (nlreturn)
		return
		^
}
s.PublishBlockMetadata(resp)
Expand All @@ -471,6 +472,7 @@ func (s *Server) fetchAndPublishOutput(ctx context.Context, outputID iotago.Outp
s.LogDebugf("fetchAndPublishOutput: %s", outputID.ToHex())
resp, err := s.NodeBridge.Client().ReadOutput(ctx, inx.NewOutputId(outputID))
if err != nil {
s.LogErrorf("failed to retrieve output %s: %v", outputID.ToHex(), err)
return

Check failure on line 476 in components/mqtt/server.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/mqtt/server.go#L476

return with no blank line before (nlreturn)
Raw output
components/mqtt/server.go:476:3: return with no blank line before (nlreturn)
		return
		^
}
s.PublishOutput(ctx, iotago.SlotIndex(resp.GetOutput().GetSlotBooked()), resp.GetOutput(), false)
Expand All @@ -480,6 +482,7 @@ func (s *Server) fetchAndPublishOutputMetadata(ctx context.Context, outputID iot
s.LogDebugf("fetchAndPublishOutputMetadata: %s", outputID.ToHex())
resp, err := s.NodeBridge.Client().ReadOutputMetadata(ctx, inx.NewOutputId(outputID))
if err != nil {
s.LogErrorf("failed to retrieve output metadata %s :%v", outputID.ToHex(), err)
return

Check failure on line 486 in components/mqtt/server.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/mqtt/server.go#L486

return with no blank line before (nlreturn)
Raw output
components/mqtt/server.go:486:3: return with no blank line before (nlreturn)
		return
		^
}
s.PublishOutputMetadata(outputID, resp)
Expand All @@ -492,6 +495,7 @@ func (s *Server) fetchAndPublishTransactionInclusion(ctx context.Context, transa

resp, err := s.NodeBridge.Client().ReadOutput(ctx, inx.NewOutputId(outputID))
if err != nil {
s.LogErrorf("failed to retrieve output of transaction %s :%v", transactionID.ToHex(), err)
return

Check failure on line 499 in components/mqtt/server.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/mqtt/server.go#L499

return with no blank line before (nlreturn)
Raw output
components/mqtt/server.go:499:3: return with no blank line before (nlreturn)
		return
		^
}

Expand All @@ -505,6 +509,7 @@ func (s *Server) fetchAndPublishTransactionInclusionWithBlock(ctx context.Contex
s.LogDebugf("fetchAndPublishTransactionInclusionWithBlock: %s", transactionID.ToHex())
resp, err := s.NodeBridge.Client().ReadBlock(ctx, inx.NewBlockId(blockID))
if err != nil {
s.LogErrorf("failed to retrieve block %s :%v", blockID.ToHex(), err)
return

Check failure on line 513 in components/mqtt/server.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/mqtt/server.go#L513

return with no blank line before (nlreturn)
Raw output
components/mqtt/server.go:513:3: return with no blank line before (nlreturn)
		return
		^
}
s.PublishTransactionIncludedBlock(transactionID, resp)
Expand Down

0 comments on commit 549d9ca

Please sign in to comment.