-
Notifications
You must be signed in to change notification settings - Fork 183
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
[Core] Networking error publisher #1070
Conversation
4d01f54
to
71c9886
Compare
|
||
logger.debug("Received Notify Message on topic: \(payload.topic)", properties: ["topic": payload.topic]) | ||
let (messagePayload, claims) = try NotifyMessagePayload.decodeAndVerify(from: payload.request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this throws will it be handled in Networking Client?
if so, isn't it strange that lower level client handles higher level client's errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Networking client not handling, just aggregating. Handling will be in Networking client publisher's subscribers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, the idea of having the "catch block" is really good but to me it's still strange that for expample:
in notify engine in networkingInteractor.subscribeOnRequest block let's say function throws a notify specific error.
for example "notify subscription not found" or whatever and that error is passed down to Networking Client.
so let's say later an app want's to listen to networking only errors and it gets "notify subscription not found"
don't you think something smells here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is the only way to have single error publisher. Depends on what we trying to acheive. By that PR I want to reduce error handling code for SDK's. One thing. May be we can delete error publisher for now and only log inside catch
block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we are mostly just logging errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still not convinced 🤔
1c5cee4
to
e4d8ec8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much better now imho!
No description provided.