@@ -19,88 +19,87 @@ static inline void handle_fastly_error(JSContext *cx, fastly_error_t err, int li
19
19
case FASTLY_ERROR_GENERIC_ERROR:
20
20
JS_ReportErrorUTF8 (cx,
21
21
" %s: Generic error value. This means that some unexpected error "
22
- " occurred during a hostcall. - Fastly error code %d \n " ,
23
- func, err );
22
+ " occurred during a hostcall.\n " ,
23
+ func);
24
24
25
25
break ;
26
26
case FASTLY_ERROR_INVALID_ARGUMENT:
27
- JS_ReportErrorUTF8 (cx, " %s: Invalid argument. - Fastly error code %d \n " , func, err );
27
+ JS_ReportErrorUTF8 (cx, " %s: Invalid argument.\n " , func);
28
28
break ;
29
29
case FASTLY_ERROR_BAD_HANDLE:
30
30
JS_ReportErrorUTF8 (cx,
31
31
" %s: Invalid handle. Thrown when a request, response, dictionary, or "
32
- " body handle is not valid. - Fastly error code %d \n " ,
33
- func, err );
32
+ " body handle is not valid.\n " ,
33
+ func);
34
34
break ;
35
35
case FASTLY_ERROR_BUFFER_LEN:
36
- JS_ReportErrorUTF8 (cx, " %s: Buffer length error. Buffer is too long. - Fastly error code %d\n " ,
37
- func, err);
36
+ JS_ReportErrorUTF8 (cx, " %s: Buffer length error. Buffer is too long.\n " , func);
38
37
break ;
39
38
case FASTLY_ERROR_UNSUPPORTED:
40
39
JS_ReportErrorUTF8 (cx,
41
40
" %s: Unsupported operation error. This error is thrown "
42
41
" when some operation cannot be performed, because it is "
43
- " not supported. - Fastly error code %d \n " ,
44
- func, err );
42
+ " not supported.\n " ,
43
+ func);
45
44
break ;
46
45
case FASTLY_ERROR_BAD_ALIGN:
47
46
JS_ReportErrorUTF8 (cx,
48
47
" %s: Alignment error. This is thrown when a pointer does not point to "
49
- " a properly aligned slice of memory. - Fastly error code %d \n " ,
50
- func, err );
48
+ " a properly aligned slice of memory.\n " ,
49
+ func);
51
50
break ;
52
51
case FASTLY_ERROR_HTTP_INVALID:
53
52
JS_ReportErrorUTF8 (cx,
54
53
" %s: HTTP parse error. This can be thrown when a method, URI, header, "
55
54
" or status is not valid. This can also be thrown if a message head is "
56
- " too large. - Fastly error code %d \n " ,
57
- func, err );
55
+ " too large.\n " ,
56
+ func);
58
57
break ;
59
58
case FASTLY_ERROR_HTTP_USER:
60
59
JS_ReportErrorUTF8 (cx,
61
60
" %s: HTTP user error. This is thrown in cases where user code caused "
62
61
" an HTTP error. For example, attempt to send a 1xx response code, or a "
63
62
" request with a non-absolute URI. This can also be caused by an "
64
63
" unexpected header: both `content-length` and `transfer-encoding`, for "
65
- " example. - Fastly error code %d \n " ,
66
- func, err );
64
+ " example.\n " ,
65
+ func);
67
66
break ;
68
67
case FASTLY_ERROR_HTTP_INCOMPLETE:
69
68
JS_ReportErrorUTF8 (cx,
70
69
" %s: HTTP incomplete message error. A stream ended "
71
- " unexpectedly. - Fastly error code %d \n " ,
72
- func, err );
70
+ " unexpectedly.\n " ,
71
+ func);
73
72
break ;
74
73
case FASTLY_ERROR_OPTIONAL_NONE:
75
74
JS_ReportErrorUTF8 (cx,
76
75
" %s: A `None` error. This status code is used to "
77
76
" indicate when an optional value did not exist, as "
78
- " opposed to an empty value. - Fastly error code %d \n " ,
79
- func, err );
77
+ " opposed to an empty value.\n " ,
78
+ func);
80
79
break ;
81
80
case FASTLY_ERROR_HTTP_HEAD_TOO_LARGE:
82
81
JS_ReportErrorUTF8 (cx,
83
82
" %s: HTTP head too large error. This error will be thrown when the "
84
- " message head is too large. - Fastly error code %d \n " ,
85
- func, err );
83
+ " message head is too large.\n " ,
84
+ func);
86
85
break ;
87
86
case FASTLY_ERROR_HTTP_INVALID_STATUS:
88
87
JS_ReportErrorUTF8 (cx,
89
88
" %s: HTTP invalid status error. This error will be "
90
89
" thrown when the HTTP message contains an invalid "
91
- " status code. - Fastly error code %d \n " ,
92
- func, err );
90
+ " status code.\n " ,
91
+ func);
93
92
break ;
94
93
case FASTLY_ERROR_LIMIT_EXCEEDED:
95
94
JS_ReportErrorUTF8 (cx,
96
95
" %s: Limit exceeded error. This error will be thrown when an attempt"
97
96
" to allocate a resource has exceeded the maximum number of resources"
98
97
" permitted. For example, creating too many response handles."
99
- " - Fastly error code %d \n " ,
100
- func, err );
98
+ " \n " ,
99
+ func);
101
100
break ;
102
101
default :
103
- fprintf (stdout, __FILE__ " :%d (%s) - Fastly error code %d \n " , line, func, err );
102
+ fprintf (stdout, __FILE__ " :%d (%s)\n " , line, func);
104
103
JS_ReportErrorUTF8 (cx, " Fastly error code %d" , err);
105
104
}
106
105
}
0 commit comments