mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-10 13:32:45 +00:00
Additional diff server error logging
This commit is contained in:
@@ -357,7 +357,17 @@ const api = {
|
|||||||
let brew = _.assign(brewFromServer, brewFromClient);
|
let brew = _.assign(brewFromServer, brewFromClient);
|
||||||
brew.title = brew.title.trim();
|
brew.title = brew.title.trim();
|
||||||
brew.description = brew.description.trim() || '';
|
brew.description = brew.description.trim() || '';
|
||||||
brew.text = applyPatches(parsePatch(brewFromClient.patches), brewFromServer.text)[0];
|
try {
|
||||||
|
const patches = parsePatch(brewFromClient.patches);
|
||||||
|
brew.text = applyPatches(patches, brewFromServer.text)[0];
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to apply patches:', {
|
||||||
|
patches: brewFromClient.patches,
|
||||||
|
brewId: brew.editId || 'unknown'
|
||||||
|
});
|
||||||
|
throw err; // rethrow to preserve the 500 behavior
|
||||||
|
}
|
||||||
|
|
||||||
brew.text = api.mergeBrewText(brew);
|
brew.text = api.mergeBrewText(brew);
|
||||||
|
|
||||||
const googleId = brew.googleId;
|
const googleId = brew.googleId;
|
||||||
|
|||||||
Reference in New Issue
Block a user