Skip to content

Conversation

@bep
Copy link
Contributor

@bep bep commented Sep 21, 2018

So a client can react to that particular error situation.

@codecov
Copy link

codecov bot commented Sep 21, 2018

Codecov Report

Merging #124 into master will not change coverage.
The diff coverage is 50%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #124   +/-   ##
=======================================
  Coverage   67.76%   67.76%           
=======================================
  Files          28       28           
  Lines        2286     2286           
=======================================
  Hits         1549     1549           
  Misses        659      659           
  Partials       78       78
Impacted Files Coverage Δ
v2/i18n/localizer.go 81.81% <50%> (ø) ⬆️

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 963e9a5...fafc61d. Read the comment docs.

@bep
Copy link
Contributor Author

bep commented Sep 21, 2018

Note that this comes from #125 -- which I guess could replace this PR if that worked. But I think it would be cleaner to just check the error.

Also, I don't understand the "codecov error". You may want to add something ala this: https://github.com/bep/s3deploy/blob/master/codecov.yml

@nicksnyder
Copy link
Owner

I don't have a problem with this PR but it would be helpful to me (for my own understanding) if you could explain your use-case for explicitly wanting to check for this error.

@bep
Copy link
Contributor Author

bep commented Sep 26, 2018

If a message with a given ID in a given language does not exist, I want to be able to both

  1. Print a WARNING that there is a missing translation
  2. Print the default language's version as a fallback

@nicksnyder nicksnyder merged commit fc57a7d into nicksnyder:master Sep 29, 2018
@nicksnyder
Copy link
Owner

Do you still think this is useful to export?

@bep
Copy link
Contributor Author

bep commented Nov 18, 2018

Do you still think this is useful to export?

Yes, as the API is now, these are the cases:

  1. Found in the current language
  2. Not found in the current language, but in some other language (check language tag)
  3. Not found in any language (check error type)
  4. Another error ... fail.

The API above could maybe be improved, but I cannot see how 3) can be handled without a way to check the error type (something ala os.IsNotExist).

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.

2 participants