cocoaheads-slovenija / charge-oclock

iOS client for theClocker; part of the learner project.
Other
4 stars 1 forks source link

Question regarding NetworkCompletion typealias #14

Open adelburekovic opened 7 years ago

adelburekovic commented 7 years ago

Is there any specific reason why the second parameter in NetworkCompletion typealias is Error and not oClockError? If it was oClockError we could show more detailed error to the user depending on the case of the enum.

Andrej123 commented 7 years ago

I guess it's done this way on purpose. oClockError inherits from Error, so as far as I know you can return the oClockerError. But you still have the flexibility to return the default error that could happen while performing json serialisation etc..

Andrej123 commented 7 years ago

However I'm puzzled why oClockerError starts with a lowercased letter.

goranche commented 7 years ago

please don't assign people to "issues" like this

goranche commented 7 years ago

I'm puzzled why

because (at the time) it looked better, since you can't put an apostrophe in the name

@adelburekovic yes, it should be the project specific error type