@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Return a HTTP 500 instead of a HTTP 400 if an internal error occurs in the Aphlict server

Summary: Ref T5651. Only throw a HTTP 400 if the data is invalid (i.e. the request is bad). If something bad happens when trying to transmit the notification, throw a HTTP 500 instead.

Test Plan: Eye-ball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5651

Differential Revision: https://secure.phabricator.com/D9968

+11 -2
+11 -2
support/aphlict/server/aphlict_server.js
··· 177 177 178 178 debug.log('notification: ' + JSON.stringify(msg)); 179 179 ++messages_in; 180 - transmit(msg); 181 180 182 - response.writeHead(200, {'Content-Type': 'text/plain'}); 181 + try { 182 + transmit(msg); 183 + response.writeHead(200, {'Content-Type': 'text/plain'}); 184 + } catch (err) { 185 + debug.log( 186 + '<%s> Internal Server Error! %s', 187 + request.socket.remoteAddress, 188 + err); 189 + response.statusCode = 500; 190 + response.write('500 Internal Server Error\n'); 191 + } 183 192 } catch (err) { 184 193 debug.log( 185 194 '<%s> Bad Request! %s',