-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* rename legacy send method to sendWithCallback * implemented async send wrapper * add async send test suite * update domain example to use async send * prettier run * cleanup * fix test * wip updating expressHandler to use async send * fixing tests * format * replace sendWithCallback to send * wip update docs * cleanup of sendSync * add TODOs for refactor * update README * prettier * add send bind again * cleanup test * clenaup tests * change title * Update lib/raygun.ts Co-authored-by: Sumitra Manga <[email protected]> * wrap HTTP request in Promise * fix: #198 reject promise on error * cleanup * adapt batch transport to transport with Promise * tests are passing * tests are passing * WIP * fix test * fixes and cleanup * add tags to debug loglines * improve logs in raygun.transport * fix: #140 throw error on incoming message too large * improving error logs * error cleanup * package-lock.json changes --------- Co-authored-by: Sumitra Manga <[email protected]>
- Loading branch information
1 parent
ad719b4
commit d8ec309
Showing
11 changed files
with
186 additions
and
172 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
import fs from "fs"; | ||
import * as transport from "./raygun.transport"; | ||
import { SendOptions, SendOptionsWithoutCB } from "./types"; | ||
import { IncomingMessage } from "http"; | ||
import { SendOptions } from "./types"; | ||
|
||
// Read stdin synchronously | ||
const data = fs.readFileSync(0, "utf-8"); | ||
|
||
const options: SendOptionsWithoutCB = JSON.parse(data); | ||
const sendOptions: SendOptions = { ...options, callback }; | ||
const options: SendOptions = JSON.parse(data); | ||
|
||
transport.send(sendOptions); | ||
|
||
function callback(error: Error | null, result: IncomingMessage | null) { | ||
if (error) { | ||
console.log(`[Raygun4Node] Error sending with sync transport`, error); | ||
} else { | ||
transport | ||
.send(options) | ||
.then((response) => { | ||
console.log( | ||
`[Raygun4Node] Successfully reported uncaught exception to Raygun`, | ||
); | ||
} | ||
} | ||
}) | ||
.catch((error) => { | ||
console.error(`[Raygun4Node] Error sending with sync transport`, error); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.