Skip to content

Commit

Permalink
fix: load data if failed completely
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio1988 committed Jan 16, 2025
1 parent d3242d4 commit 73c987b
Show file tree
Hide file tree
Showing 2 changed files with 14,572 additions and 1 deletion.
3 changes: 2 additions & 1 deletion decoder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ func InitialiseOhbem() {

if err := o.FetchPokemonData(); err != nil {
if err2 := o.LoadPokemonData(cacheFileLocation); err2 != nil {
log.Errorf("ohbem.FetchPokemonData failed. ohbem.LoadPokemonData failed: %s", err2)
_ = o.LoadPokemonData("pogo/master-latest-basics.json")
log.Errorf("ohbem.FetchPokemonData failed. ohbem.LoadPokemonData from cache failed: %s. Loading from pogo/master-latest-basics.json instead.", err2)
} else {
log.Warnf("ohbem.FetchPokemonData failed, loaded from cache: %s", err)
}
Expand Down
Loading

0 comments on commit 73c987b

Please sign in to comment.