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

NOISSUE - Implement errors package in senml transformer, readers and writers #1108

Merged
merged 5 commits into from
Apr 13, 2020

Conversation

blokovi
Copy link
Contributor

@blokovi blokovi commented Apr 13, 2020

Signed-off-by: Ivan Milošević iva@blokovi.com

What does this do?

Use mainflux errors package in senml transformer, readers and writers

Which issue(s) does this PR fix/relate to?

Related to issues #538 and #870

List any changes that modify/break current functionality

Readers' API endpoints return error message in response body for errors (not just status response code in header)

Have you included tests for your changes?

Yes

Signed-off-by: Ivan Milošević <iva@blokovi.com>
@blokovi blokovi requested a review from a team as a code owner April 13, 2020 00:06
writers/postgres/messages.go Outdated Show resolved Hide resolved
readers/postgres/messages.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Apr 13, 2020

Codecov Report

Merging #1108 into master will decrease coverage by 0.05%.
The diff coverage is 26.31%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1108      +/-   ##
==========================================
- Coverage   76.96%   76.90%   -0.06%     
==========================================
  Files          95       95              
  Lines        6823     6786      -37     
==========================================
- Hits         5251     5219      -32     
+ Misses       1231     1224       -7     
- Partials      341      343       +2     
Impacted Files Coverage Δ
readers/api/responses.go 100.00% <ø> (ø)
readers/cassandra/messages.go 88.46% <0.00%> (ø)
readers/influxdb/messages.go 76.92% <0.00%> (ø)
readers/mongodb/messages.go 86.44% <0.00%> (ø)
readers/postgres/messages.go 90.76% <0.00%> (ø)
writers/cassandra/messages.go 86.66% <0.00%> (ø)
writers/postgres/messages.go 58.82% <14.28%> (-2.41%) ⬇️
writers/influxdb/messages.go 73.33% <20.00%> (-3.42%) ⬇️
writers/mongodb/messages.go 73.33% <33.33%> (-5.24%) ⬇️
transformers/senml/transformer.go 93.10% <50.00%> (-1.19%) ⬇️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e438be4...c3e3343. Read the comment docs.

Return wrapped error in postgres writer

Signed-off-by: Ivan Milošević <iva@blokovi.com>
drasko
drasko previously approved these changes Apr 13, 2020
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@blokovi blokovi changed the title Implement errors package in senml transformer, readers and writers NOISSUE - Implement errors package in senml transformer, readers and writers Apr 13, 2020
@@ -31,7 +31,7 @@ import (
)

const (
svcName = "postgres-writer"
svcName = "postgres-reader"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

transformers/senml/transformer.go Outdated Show resolved Hide resolved
Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Ivan Milošević <iva@blokovi.com>
manuio
manuio previously approved these changes Apr 13, 2020
Copy link
Contributor

@manuio manuio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Copy link
Contributor

@manuio manuio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@drasko drasko merged commit 880e193 into absmach:master Apr 13, 2020
@blokovi blokovi deleted the errorsmqtt branch April 13, 2020 11:07
manuio pushed a commit that referenced this pull request Oct 12, 2020
…writers (#1108)

* Implement errors package in senml transformer, readers and writers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove unused const
Return wrapped error in postgres writer

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix default db host in postgres writer

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix capital letters in errors messages

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* use svcName instead of postgres for Promethius initialization

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants