@@ -123,6 +123,7 @@ extern "C" {
123
123
msg_stream << " Unable to allocate memory: " << ba.what () << std::endl;
124
124
json_append_member (json_err, " status" , json_mknumber (2 ));
125
125
json_append_member (json_err, " message" , json_mkstring (ba.what ()));
126
+ json_append_member (json_err, " formatted" , json_mkstring (msg_stream.str ().c_str ()));
126
127
c_ctx->error_json = json_stringify (json_err, " " );;
127
128
c_ctx->error_message = sass_strdup (msg_stream.str ().c_str ());
128
129
c_ctx->error_text = sass_strdup (ba.what ());
@@ -134,9 +135,10 @@ extern "C" {
134
135
catch (std::exception& e) {
135
136
std::stringstream msg_stream;
136
137
JsonNode* json_err = json_mkobject ();
137
- msg_stream << " Error: " << e.what () << std::endl;
138
+ msg_stream << " Internal Error: " << e.what () << std::endl;
138
139
json_append_member (json_err, " status" , json_mknumber (3 ));
139
140
json_append_member (json_err, " message" , json_mkstring (e.what ()));
141
+ json_append_member (json_err, " formatted" , json_mkstring (msg_stream.str ().c_str ()));
140
142
c_ctx->error_json = json_stringify (json_err, " " );;
141
143
c_ctx->error_message = sass_strdup (msg_stream.str ().c_str ());
142
144
c_ctx->error_text = sass_strdup (e.what ());
@@ -148,9 +150,10 @@ extern "C" {
148
150
catch (std::string& e) {
149
151
std::stringstream msg_stream;
150
152
JsonNode* json_err = json_mkobject ();
151
- msg_stream << " Error: " << e << std::endl;
153
+ msg_stream << " Internal Error: " << e << std::endl;
152
154
json_append_member (json_err, " status" , json_mknumber (4 ));
153
155
json_append_member (json_err, " message" , json_mkstring (e.c_str ()));
156
+ json_append_member (json_err, " formatted" , json_mkstring (msg_stream.str ().c_str ()));
154
157
c_ctx->error_json = json_stringify (json_err, " " );;
155
158
c_ctx->error_message = sass_strdup (msg_stream.str ().c_str ());
156
159
c_ctx->error_text = sass_strdup (e.c_str ());
@@ -162,9 +165,10 @@ extern "C" {
162
165
catch (const char * e) {
163
166
std::stringstream msg_stream;
164
167
JsonNode* json_err = json_mkobject ();
165
- msg_stream << " Error: " << e << std::endl;
168
+ msg_stream << " Internal Error: " << e << std::endl;
166
169
json_append_member (json_err, " status" , json_mknumber (4 ));
167
170
json_append_member (json_err, " message" , json_mkstring (e));
171
+ json_append_member (json_err, " formatted" , json_mkstring (msg_stream.str ().c_str ()));
168
172
c_ctx->error_json = json_stringify (json_err, " " );;
169
173
c_ctx->error_message = sass_strdup (msg_stream.str ().c_str ());
170
174
c_ctx->error_text = sass_strdup (e);
0 commit comments