Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
fix(logging): remove unnecessary websocket error msg, clean up copy e…
Browse files Browse the repository at this point in the history
…rror msg

remove unnecessary websocket error msg, clean up copy error msg
  • Loading branch information
danbucholtz committed Nov 21, 2016
1 parent 3ec5103 commit 1517b06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function copyUpdate(event: string, filePath: string, context: BuildContex
return copySrcToDest(context, copyOptions.src, copyOptions.dest, copyOptions.filter, true);
});
return Promise.all(promises).then((copySrcToDestResults: CopySrcToDestResult[]) => {
printCopyErrorMessages('copy', copySrcToDestResults);
printCopyErrorMessages(copySrcToDestResults);
const destFiles = copySrcToDestResults.map(copySrcToDestResult => copySrcToDestResult.dest);
emit(EventType.FileChange, destFiles);
});
Expand Down Expand Up @@ -76,14 +76,14 @@ export function copyWorker(context: BuildContext, configFile: string) {
});

return Promise.all(promises).then((copySrcToDestResults: CopySrcToDestResult[]) => {
printCopyErrorMessages('copy', copySrcToDestResults);
printCopyErrorMessages(copySrcToDestResults);
});
}

function printCopyErrorMessages(prefix: string, copyResults: CopySrcToDestResult[]) {
function printCopyErrorMessages(copyResults: CopySrcToDestResult[]) {
copyResults.forEach(copyResult => {
if (!copyResult.success) {
Logger.warn(`${prefix}: ${copyResult.errorMessage}`);
Logger.warn(copyResult.errorMessage);
}
});
}
Expand Down
4 changes: 3 additions & 1 deletion src/dev-server/notification-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export function createNotificationServer(config: ServeConfig) {
try {
wsServer.send(JSON.stringify(msg));
} catch (e) {
Logger.error(`error sending client ws, ${e}`);
if (e.message !== 'not opened') {
Logger.error(`error sending client ws - ${e.message}`);
}
}
}
}
Expand Down

0 comments on commit 1517b06

Please sign in to comment.