Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
LEARNER-4802
Browse files Browse the repository at this point in the history
- Add debug logs to figure out the crash.
  • Loading branch information
farhan committed Mar 29, 2018
1 parent a72076b commit 06b3f01
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ public class CourseContentNotValidException extends Exception {
public CourseContentNotValidException(@NonNull String message) {
super(message);
}

public CourseContentNotValidException(String message, Exception e) {
super(message, e);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,28 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
bundle = getArguments();
}
}
restore(bundle);

final View view = inflater.inflate(R.layout.fragment_course_outline_new, container, false);
initListView(view);
listView = (ListView) view.findViewById(R.id.outline_list);
errorNotification = new FullScreenErrorNotification(listView);
loadingIndicator = view.findViewById(R.id.loading_indicator);
fetchCourseComponent();

try {
restore(bundle);
initListView(view);
fetchCourseComponent();
} catch (Exception e) {
final StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("CourseId: "+courseData.getCourse().getId())
.append(", CourseName: "+courseData.getCourse().getName())
.append(", CourseComponentId: "+courseComponentId)
.append(", isVideoMode: "+isVideoMode)
.append("\n Exception: "+e.getMessage());
final CourseContentNotValidException ex = new CourseContentNotValidException(stringBuilder.toString(), e);
errorNotification.showError(getContext(), ex);
logger.error(ex, true);
}

return view;
}

Expand Down Expand Up @@ -234,7 +249,6 @@ protected void onFinish() {
}

private void initListView(@NonNull View view) {
listView = (ListView) view.findViewById(R.id.outline_list);
initAdapter();
listView.setAdapter(adapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
Expand Down

0 comments on commit 06b3f01

Please sign in to comment.