Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Type to relationshipWasNil RuneError #86

Merged
merged 2 commits into from
Jun 14, 2022

Conversation

seanmiller802
Copy link
Collaborator

No description provided.

Copy link
Member

@joshuawright11 joshuawright11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Can we pass the type to the error function? Will prevent callers of the function from passing in a String that isn't actually a type.

public static func relationshipWasNil<M: Model>(type: M.Type) -> RuneError {
    RuneError("This non-optional relationship to \(type) has no matching models.")
}

Then call like...

RuneError.relationshipWasNil(type: Self.self)

@seanmiller802 seanmiller802 merged commit d62982c into main Jun 14, 2022
@joshuawright11 joshuawright11 deleted the add-expected-type-to-relationshipWasNil branch June 14, 2022 18:42
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants