err_resp(agooRes res, agooErr err, int status) {
    char		buf[1024];
    int			cnt;
    int64_t		now = agoo_now_nano();
    time_t		t = (time_t)(now / 1000000000LL);
    long long		frac = (long long)now % 1000000000LL;
    struct _agooTime	at;
    const char		*code = agoo_err_str(err->code);
    int			clen = (int)strlen(code);

    agoo_sectime(t, &at);
    cnt = snprintf(buf, sizeof(buf),
		   "HTTP/1.1 %d %s\r\nContent-Type: application/json\r\nContent-Length: %ld\r\n\r\n{\"errors\":[{\"message\":\"%s\",\"code\":\"%s\",\"timestamp\":\"%04d-%02d-%02dT%02d:%02d:%02d.%09lldZ\"}]}",
		   status, agoo_http_code_message(status), strlen(err->msg) + 27 + 45 + clen + 10, err->msg,
		   code,
		   at.year, at.mon, at.day, at.hour, at.min, at.sec, frac);

    agoo_res_message_push(res, agoo_text_create(buf, cnt));
}
err_resp(agooRes res, agooErr err, int status) {
    char		buf[1024];
    int			cnt;
    int64_t		now = agoo_now_nano();
    time_t		t = (time_t)(now / 1000000000LL);
    long long		frac = (long long)now % 1000000000LL;
    struct _agooTime	at;
    const char		*code = agoo_err_str(err->code);
    int			clen = (int)strlen(code);

    agoo_sectime(t, &at);
    cnt = snprintf(buf, sizeof(buf),
		   "HTTP/1.1 %d %s\r\nContent-Type: application/json\r\nContent-Length: %ld\r\n\r\n{\"errors\":[{\"message\":\"%s\",\"code\":\"%s\",\"timestamp\":\"%04d-%02d-%02dT%02d:%02d:%02d.%09lldZ\"}]}",
		   status, agoo_http_code_message(status), strlen(err->msg) + 27 + 45 + clen + 10, err->msg,
		   code,
		   at.year, at.mon, at.day, at.hour, at.min, at.sec, frac);

    agoo_res_message_push(res, agoo_text_create(buf, cnt));
}