Skip to content

No more calls to fatalError#538

Open
berikv wants to merge 4 commits into
SnapKit:developfrom
berikv:NoFatalError
Open

No more calls to fatalError#538
berikv wants to merge 4 commits into
SnapKit:developfrom
berikv:NoFatalError

Conversation

@berikv
Copy link
Copy Markdown

@berikv berikv commented Sep 5, 2018

Fixes #537

In this change

  • The constraint maker no longer calls fatalError but emits a ConstraintMakerEditable with an error inside
  • The prepareConstraints(item:closure:) method checks for errors and calls the ConstraintMakerErrorHandler
  • The ConstraintMakerErrorHandler calls to assertionFailure instead of fatalError to prevent production crashers. Its behaviour can be globally overridden
  • All calls to fatalError have been changed to call assertionFailure
  • An unneeded force unwrap has been resolved
  • Make layoutConstraintItem non optional because its optionality is not needed and not handled well

Berik Visschers added 4 commits September 5, 2018 14:46
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.

Feature request: No calls to fatalError in production code

2 participants