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

Remove Generic Exception prefix for form submission errors #6526

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lognaturel
Copy link
Member

@lognaturel lognaturel commented Nov 21, 2024

This is a pet peeve of mine that I'm hoping will be an easy accept. I am annoyed every time I see "Error: Generic Exception: Error: " It looks like a mistake. I have never seen an error for which "Error: Generic Exception" added any information.

Before After
Screenshot_20241121_113101 Screenshot_20241121_113909

Why is this the best possible solution? Were any other approaches considered?

I considered only removing the Error: prefix but I really don't think Generic Exception adds anything either.

I didn't add any tests. I verified that there are no tests that expect that text currently.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

The biggest risk would be that there's an exception without any error message at all. But I think seeing the exception name, which the toString should give us, is way more useful than the static "Generic Exception" text.

Do we need any specific form for testing your changes? If so, please attach one.

No.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
    there were no existing tests so it feels ok to leave as-is.
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
    I don't see any reason to run connected tests for this change.
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@lognaturel lognaturel changed the title Remove Generic Exception perfix for form submission Remove Generic Exception prefix for form submission Nov 21, 2024
@lognaturel lognaturel changed the title Remove Generic Exception prefix for form submission Remove Generic Exception prefix for form submission errors Nov 21, 2024
@grzesiek2010
Copy link
Member

I considered only removing the Error:

This indicates that the message already includes that prefix. Is this true for other messages as well?

@lognaturel
Copy link
Member Author

I don't think all of them would but the most commons one, yes! Even more reason to get rid of the prefix, I think.

Any ideas why the style check is failing? It always gives a trace like

The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=55e6c392-3690-4a1c-b395-6e8a6086a94a, currentDir=/home/circleci/work}
Attempting to read last messages from the daemon log...
Daemon pid: 124
  log file: /home/circleci/.gradle/daemon/8.8/daemon-124.out.log
----- Last  20 lines from daemon log file - daemon-124.out.log -----
Warning at /home/circleci/work/config/pmd-ruleset.xml:159:9
 157|         <exclude name="InefficientStringBuffering" />
 158|         <exclude name="InsufficientStringBufferDeclaration" />
 159|         <exclude name="SimplifyStartsWith" />
              ^^^^^^^^ Exclude pattern 'SimplifyStartsWith' did not match any rule in ruleset 'category/java/performance.xml'

 160|         <exclude name="TooFewBranchesForASwitchStatement" /> <!-- Decided not to use in #2564 -->
 161|         <exclude name="UseArraysAsList" />
Wrote HTML report to file:///home/circleci/work/androidtest/build/reports/lint-results-debug.html
Wrote HTML report to file:///home/circleci/work/androidshared/build/reports/lint-results-debug.html
Wrote HTML report to file:///home/circleci/work/audio-clips/build/reports/lint-results-debug.html
Wrote HTML report to file:///home/circleci/work/audio-recorder/build/reports/lint-results-debug.html
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Warning: Lint will treat :shared as an external dependency and not analyze it.
 * Recommended Action: Apply the 'com.android.lint' plugin to java library project :shared. to enable lint to analyze those sources.

Warning: Lint will treat :forms as an external dependency and not analyze it.
 * Recommended Action: Apply the 'com.android.lint' plugin to java library project :forms. to enable lint to analyze those sources.

----- End of the daemon log -----


FAILURE: Build failed with an exception.

* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

It passes locally. It fails at slightly different points each time and it feels like a resource thing to me. Is it a problem that has happened on other PRs?

@seadowg seadowg requested review from seadowg and removed request for grzesiek2010 November 26, 2024 15:51
@seadowg
Copy link
Member

seadowg commented Nov 27, 2024

@lognaturel I'm not able to rerun failed tests for this (more on that later), but I can confirm this works locally for me. My guess would be that Circle CI was having issues when you were working on this. Could you try rerunning?

I'm not sure why the rerun is disabled for me. I'm guessing it's because Circle CI is running the checks in the "lognaturel" org instead of "getodk" (which is used for @grzesiek2010 and I). I'll have a look at Circle CI's docs.

@seadowg
Copy link
Member

seadowg commented Nov 27, 2024

@lognaturel I'm pretty sure you've somehow set up your fork of getodk/collect with its own Circle CI project which could be causing problems here. Could you go to your org (should be https://app.circleci.com/organization/github/lognaturel), remove the Collect project if there is one and then push this again?

Copy link
Member

@seadowg seadowg left a comment

Choose a reason for hiding this comment

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

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