-
Notifications
You must be signed in to change notification settings - Fork 118
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
Improve error messages #780
Conversation
val autoGoogleLogin = cli?.autoGoogleLogin ?: cli?.noAutoGoogleLogin?.not() ?: androidGcloud.autoGoogleLogin | ||
|
||
// We use not() on noUseOrchestrator because if the flag is on, useOrchestrator needs to be false | ||
val useOrchestrator = cli?.useOrchestrator ?: cli?.noUseOrchestrator?.not() ?: androidGcloud.useOrchestrator | ||
val roboDirectives = cli?.roboDirectives?.parseRoboDirectives() ?: androidGcloud.roboDirectives.parseRoboDirectives() | ||
val roboDirectives = | ||
cli?.roboDirectives?.parseRoboDirectives() ?: androidGcloud.roboDirectives.parseRoboDirectives() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why the formatting is being changed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's auto code format change. Before save file I always use auto code format. If it wrong or I shouldn't commit this changes let me know, I can revert it. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto wrapping isn't works well in many cases i prefer to do it by hand. Its also good idea to expand setting General -> Code Style -> Hard wrap at
to 200 for example, to avoid accidental wrappings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Now i set Hard wrap to 200 i revert changes.
"test" : "./src/test/kotlin/ftl/fixtures/tmp/apk/app-single-success-debug-androidTest.apk", | ||
"device" : { | ||
"version" : "test" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new error format looks awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls revert accidental wrappings, intellij is not doing it well automatically. Anyway great job!
val autoGoogleLogin = cli?.autoGoogleLogin ?: cli?.noAutoGoogleLogin?.not() ?: androidGcloud.autoGoogleLogin | ||
|
||
// We use not() on noUseOrchestrator because if the flag is on, useOrchestrator needs to be false | ||
val useOrchestrator = cli?.useOrchestrator ?: cli?.noUseOrchestrator?.not() ?: androidGcloud.useOrchestrator | ||
val roboDirectives = cli?.roboDirectives?.parseRoboDirectives() ?: androidGcloud.roboDirectives.parseRoboDirectives() | ||
val roboDirectives = | ||
cli?.roboDirectives?.parseRoboDirectives() ?: androidGcloud.roboDirectives.parseRoboDirectives() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto wrapping isn't works well in many cases i prefer to do it by hand. Its also good idea to expand setting General -> Code Style -> Hard wrap at
to 200 for example, to avoid accidental wrappings.
import com.fasterxml.jackson.databind.JsonNode | ||
import java.lang.Exception | ||
|
||
class ConfigurationErrorMessageBuilder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion. This class has no state and no constructor arguments, there is no reasons to create new instances. It could be object or even function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I made changes :)
@@ -0,0 +1,30 @@ | |||
package ftl.args.yml.errors | |||
|
|||
internal class ConfigurationErrorParser { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no state, no constructor args, no needs for class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I made changes :)
|
||
import com.fasterxml.jackson.databind.JsonNode | ||
|
||
internal class ErrorNodeResolver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no state, no constructor args, no needs for class :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I made changes :)
Hey @adamfilipow92 great job with! Error messages look much better now.
results with nasty error with stack trace like
Error with wrong type of data like
results with
which is not very useful for me since I still don't know what is wrong (yeah, in this particular example it's rather clear) On the other hand flank is not for casual users and every dev should now basics of yml files... cc Let me all know what you think. |
I think these would be great to address in follow up PRs. They're definitely improvements we want to make. I like to have small pull requests that get merged quickly. The longer a pull request stays open, the higher the cost to maintain and deal with merge conflicts. https://google.github.io/eng-practices/review/developer/small-cls.html |
Really thanks for tests! My regex to for get "clean" reference chain was ignoring properties with '-' in name. I fix it and now in case with that property we have better informations. Like this: |
@bootstraponline I want make some more improvments to this issue. Based of @pawelpasterz suggestion handle more cases. Even if messages of them are better we could make some changes and convert them to one generic excepion for parsing errors like FlankConfigurationException. ` ` |
@adamfilipow92 Fine for me, let's create separate issue to track progress |
Fixes #656
Checklist