Skip to content

Commit

Permalink
use helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ocean committed Jul 30, 2024
1 parent e7e0bc7 commit 048237a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/P2P/handleProtocolCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ export async function handleProtocolCommands(connection: any) {
}
if (!task) {
P2P_LOGGER.error('Invalid or missing task/command data!')
status = { httpStatus: 400, error: 'Invalid command' }
statusStream = new ReadableString(JSON.stringify(status))
statusStream = new ReadableString(
JSON.stringify(buildWrongCommandStatus(400, 'Invalid command'))
)
pipe(statusStream, connection.stream.sink)
return
} else {
Expand Down

0 comments on commit 048237a

Please sign in to comment.