Added basic HTML generation and response handling.
[jrw.git] / src / jrw / resp / HttpError.java
CommitLineData
6e0043cc
FT
1package jrw.resp;
2
3import jrw.*;
4import jrw.sp.*;
5import jrw.util.*;
6import java.util.*;
7
8public class HttpError extends UserError {
9 public int code;
10
11 public HttpError(int code, String title, Object detail) {
12 super(title, detail);
13 this.code = code;
14 }
15 public HttpError(int code, Object detail) {
16 this(code, Http.statusinfo.get(code).status, detail);
17 }
18 public HttpError(int code) {
19 this(code, Http.statusinfo.get(code).message);
20 }
21
22 public Map<Object, Object> handle(Request req) {
23 req.status(code + " " + skel.title);
24 return(super.handle(req));
25 }
26}