Skip to content

Commit

Permalink
add error rethow on task logic
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Lu-none committed Dec 21, 2023
1 parent 94f6d31 commit d896162
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/src/connector/score_connector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class ScoreConnector {
return courseScoreList;
} catch (e, stack) {
Log.eWithStack(e.toString(), stack);
return null;
rethrow;
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/task/score/score_rank_task.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class ScoreRankTask extends ScoreSystemTask<List<SemesterCourseScoreJson>> {
result = value;
return TaskStatus.success;
} catch (e) {
//TODO: generate strings for UI
if (e is FormatException) {
return super.onError(R.current.getScoreRankError);
return super.onError("請先完成學期評量");
} else {
//TODO: regenerate the string for this
return super.onError("取得課表錯誤");
}
}
Expand Down

0 comments on commit d896162

Please sign in to comment.