Add programmaticaly useful error signalling
ClosedPublic

Authored by leinir on Nov 4 2018, 4:38 PM.

Details

Summary

Previously, KNSCore only signalled errors using string messages, which were useful for fault finding, but not useful when attempting to handle errors during general operation. This patch adds a signal which is fired at the same time as some error messages, and which provides error condition information which is useful in a programmatical fashion.

This patch would allow https://bugs.kde.org/show_bug.cgi?id=395937 to be fixed in a non-hackish fashion.

Diff Detail

Repository
R304 KNewStuff
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
leinir created this revision.Nov 4 2018, 4:38 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 4 2018, 4:38 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
leinir requested review of this revision.Nov 4 2018, 4:38 PM
apol requested changes to this revision.Nov 5 2018, 12:10 AM
apol added inline comments.
src/core/engine.h
430

I would include the error message here and deprecate signalError. Otherwise it's going to be a mess matching both signals.

This revision now requires changes to proceed.Nov 5 2018, 12:10 AM
leinir marked an inline comment as done.Nov 7 2018, 1:14 PM
leinir added inline comments.
src/core/engine.h
430

Quite a good point, yes - i've done a bit of jiggling around, new patch incoming

leinir updated this revision to Diff 45032.Nov 7 2018, 1:31 PM
leinir marked an inline comment as done.

Adjust the patch to address @apol's comment about deprecating the old error signal

apol accepted this revision.Nov 7 2018, 2:01 PM

LGTM

This revision is now accepted and ready to land.Nov 7 2018, 2:01 PM
apol added a comment.Nov 7 2018, 2:02 PM

Maybe it would be good to produce the Discover patch before committing this to make sure the API is the one we want.

leinir added a comment.Nov 7 2018, 2:03 PM
In D16665#355578, @apol wrote:

Maybe it would be good to produce the Discover patch before committing this to make sure the API is the one we want.

Good idea, yes, i'll get that whipped together and submitted with reference to this one :)

This revision was automatically updated to reflect the committed changes.