Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

More detailed error message with method arguments #990

Merged

Conversation

bannzai
Copy link
Contributor

@bannzai bannzai commented Nov 26, 2020

Abstract

This PR shows more detailed fatalError message with target and project names when cause fatalError in PBXProjGenerator.generateExternalTargetDependency(from:,target:, project:, platform:)

Motivation

Team member got below error messages. But we can not understand which target in project.
So, Think I improved error message for development with xcodegen.

Fatal error: target not found: file XcodeGenKit/PBXProjGenerator.swift, line 374

@bannzai bannzai marked this pull request as ready for review November 26, 2020 06:49
@@ -370,13 +370,13 @@ public class PBXProjGenerator {

func generateExternalTargetDependency(from: String, to target: String, in project: String, platform: Platform) throws -> (PBXTargetDependency, Target, PBXReferenceProxy) {
guard let projectReference = self.project.getProjectReference(project) else {
fatalError("project not found")
fatalError("project '\(project)' not found")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you describe sample outputs?

I'm curious about how to express this object by CustomStringConvertible 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe you're misunderstanding.

project is String. Not object like class 👻

Copy link
Owner

@yonaskolb yonaskolb left a comment

Choose a reason for hiding this comment

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

Great, thanks @bannzai. Could you please add a changelog entry as well

@bannzai
Copy link
Contributor Author

bannzai commented Nov 30, 2020

I added changelog entry :)

@yonaskolb yonaskolb merged commit 79738b3 into yonaskolb:master Dec 1, 2020
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.

3 participants