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

Clear Invalid Filename Error Message #280

Merged
merged 4 commits into from
May 19, 2019

Conversation

lincmba
Copy link
Contributor

@lincmba lincmba commented Mar 29, 2019

Provide a clear error message. State exact error, if a filename is invalid.
Fixes #22

@lincmba lincmba force-pushed the 22-clear-filename-error-message branch from c1acab7 to 4e61a28 Compare March 29, 2019 14:22
@codecov-io
Copy link

codecov-io commented Mar 29, 2019

Codecov Report

Merging #280 into master will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #280     +/-   ##
========================================
+ Coverage   81.19%   81.3%   +0.1%     
========================================
  Files          23      23             
  Lines        3106    3108      +2     
  Branches      729     729             
========================================
+ Hits         2522    2527      +5     
+ Misses        450     448      -2     
+ Partials      134     133      -1
Impacted Files Coverage Δ
pyxform/survey_element.py 90.04% <100%> (+1.6%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbfac0a...f4728bf. Read the comment docs.

@lincmba lincmba force-pushed the 22-clear-filename-error-message branch from 31f8375 to 94d1656 Compare April 5, 2019 11:44
Signed-off-by: Lincoln Simba <[email protected]>
" include numbers, dashes, and periods." % self.name
invalid_char = re.search(INVALID_XFORM_TAG_REGEXP, self.name)
msg = "Invalid name. Remove '{}' from '{}'".format(
invalid_char.group(0), self.name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's retain a bit of the original message, but show the offending characters. For example, The name 'badfile@name' is an invalid XML tag, it contains invalid character(s) '@'. Names must begin with a letter, colon, or underscore, subsequent characters can include numbers, dashes, and periods.

@lincmba lincmba force-pushed the 22-clear-filename-error-message branch from 9f5fc1c to f4728bf Compare May 7, 2019 06:05
@ukanga ukanga merged commit 3fe7546 into XLSForm:master May 19, 2019
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.

Clear error message when processing a file with spaces in the filename e.g 'tutorial .xls'
3 participants