1 package org.paneris.bibliomania;
2
3 import org.melati.util.MelatiRuntimeException;
4
5 public class PaginationException extends MelatiRuntimeException {
6
7
8
9 private static final long serialVersionUID = 1L;
10 public String chapter;
11
12 public PaginationException(Chapter chapter, Exception problem) {
13 super(problem);
14 try {
15 this.chapter = chapter.getBook().getTitle() + " - " +
16 chapter.getSequence() + ". " + chapter.getTitle();
17 }
18 catch (Exception e) {
19 this.chapter = chapter.toString();
20 }
21 }
22
23 public String getMessage() {
24 return "A problem arose running the pagination subsystem on chapter " +
25 "`" + chapter + "'" +
26 (subException == null ? "" : "\n" + subException.getMessage());
27 }
28 }