Slide 1

Slide 1 text

Fail better CocoaHeads Paris “Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.” Samuel Beckett

Slide 2

Slide 2 text

presentError:

Slide 3

Slide 3 text

Introduced in Mac OS 10.4

Slide 4

Slide 4 text

-[NSResponder presentError:]

Slide 5

Slide 5 text

Follows the responder chain

Slide 6

Slide 6 text

-[NSResponder willPresentError:]

Slide 7

Slide 7 text

From http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ ErrorHandlingCocoa/ErrorHandling/ErrorHandling.html

Slide 8

Slide 8 text

From http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ ErrorHandlingCocoa/ErrorHandling/ErrorHandling.html

Slide 9

Slide 9 text

Why so cool?

Slide 10

Slide 10 text

Contextualization!

Slide 11

Slide 11 text

1. Level of information 2. Visual context

Slide 12

Slide 12 text

1. Level of information “I want errors precise, but still understandable”

Slide 13

Slide 13 text

➤ generate precise errors ➤ rewrite errors for to the context

Slide 14

Slide 14 text

2. Visual context “Where did this error occur?”

Slide 15

Slide 15 text

➤ embedding errors in the UI

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Available on UIResponder too !

Slide 19

Slide 19 text

Available on UIResponder too !

Slide 20

Slide 20 text

Re-implement!

Slide 21

Slide 21 text

Demo

Slide 22

Slide 22 text

Links github.com/kemenaran/ios-presentError github.com/hectr/ErrorKit

Slide 23

Slide 23 text

Slide 24

Slide 24 text

Thanks