Skip to content

Commit

Permalink
1.5.0 take 2 (#51)
Browse files Browse the repository at this point in the history
Release for 1.5.0

feature: Added .sendAsync() entry point wrapping the HTTP call into its own thread.
chore: Regorganisation of code in RaygunClient
fix: Improving handling of getHTTPRequestData in RaygunRequestMessage
chore: Changed HTTP endpoint to .com
feature: Supports groupingKey now
  • Loading branch information
TheRealAgentK authored Nov 15, 2022
1 parent 08ef6dd commit edd82d4
Show file tree
Hide file tree
Showing 26 changed files with 769 additions and 542 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ raygun4cfml

Raygun Crash Reporting client for CFML.

Current Version: 1.4.0 (May 24 2022)
Current Version: 1.5.0 (November 14 2022)

Dependencies:

Expand Down
4 changes: 2 additions & 2 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name":"raygun4cfml",
"version":"1.4.0",
"location":"MindscapeHQ/raygun4cfml#1.4.0",
"version":"1.5.0",
"location":"MindscapeHQ/raygun4cfml#1.5.0",
"author":"Kai Koenig <[email protected]>",
"homepage":"https://github.com/MindscapeHQ/raygun4cfml/",
"documentation":"https://github.com/MindscapeHQ/raygun4cfml/blob/master/README.md",
Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
History
=======

1.5.0 (November 14 2022)

- Added .sendAsync() entry point wrapping the HTTP call into its own thread.
- Regorganisation of code in RaygunClient
- Improving handling of getHTTPRequestData in RaygunRequestMessage
- Changed HTTP endpoint to .com
- Supports groupingKey now

1.4.0 (May 24 2022)

- Supporting stack traces where certain elements (like TagContext) don't exist
Expand Down
58 changes: 28 additions & 30 deletions samples/ColdBox_3.6.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,42 @@ Please direct questions to the GitHub repository: https://github.com/MindscapeHQ

2. Append the following to config/coldbox.cfc:

coldbox = {
exceptionHandler = "Main.onException",
onInvalidEvent = "Main.invalidEvent"
}
coldbox = {
exceptionHandler = "Main.onException",
onInvalidEvent = "Main.invalidEvent"
}

3. Append the following to config/wirebox.cfc

map("RayGunClient").to("model.raygun4cfml.RayGunClient")
.asSingleton()
.initArg(name="apiKey",value="****YOUR-API-KEY-GOES-HERE****");

4. To catch exceptions, create or append the following to handlers/main.cfc (or wherever you want, I use error.cfc, but then you have to change the path in
map("RayGunClient").to("model.raygun4cfml.RayGunClient")
.asSingleton()
.initArg(name="apiKey",value="****YOUR-API-KEY-GOES-HERE****");

step 2)
4. To catch exceptions, create or append the following to handlers/main.cfc (or wherever you want, I use error.cfc, but then you have to change the path in step 2)

<cfscript>
<cfscript>

property name="RayGunClient" inject="id:RayGunClient";
property name="RayGunClient" inject="id:RayGunClient";

public void function onException (event, rc, prc) {
var exceptionBean = event.getValue("ExceptionBean");
sendExceptionToRayGun(exceptionBean);
//Do whatever other error handling you want here
}
public void function onException (event, rc, prc) {
var exceptionBean = event.getValue("ExceptionBean");
sendExceptionToRayGun(exceptionBean);
//Do whatever other error handling you want here
}

private void function sendExceptionToRayGun (required exception) {
RayGunClient.send(exception);
}
private void function sendExceptionToRayGun (required exception) {
RayGunClient.send(exception);
}


public void function invalidEvent (event,rc,prc) {
try {
throw (message="Invalid Event: #event.getCurrentEvent()#", type="Application", errorCode="404");
}
catch (any e) {
sendExceptionToRayGun(e);
}
//Render whatever message you want here
}
public void function invalidEvent (event,rc,prc) {
try {
throw (message="Invalid Event: #event.getCurrentEvent()#", type="Application", errorCode="404");
}
catch (any e) {
sendExceptionToRayGun(e);
}
//Render whatever message you want here
}

</cfscript>
</cfscript>
46 changes: 23 additions & 23 deletions samples/global_errorhandler/errortemplate.cfm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
Copyright 2013 Kai Koenig, Ventego Creative Ltd
Copyright 2022 Kai Koenig, Ventego Creative Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -18,23 +18,23 @@ limitations under the License.
// This is a set of examples for using Raygun.io in a global error handler template,
// e.g. cferror or a template that's hooked into the ColdFusion Administrator
// 1. Using a content filter
// 1. Using a content filter
//
// The actual filter is an array of structs containing two properties: filter, replacement
// filter: regExp to find key in URL or FORM scopes
// replacement: replacement value for the key's value
//
// Sample with filter (error is the CF error structure provided to the error template(s), variables.RAYGUNAPIKEY is the Raygun.io API key)
//
// filter = [{filter = "password", replacement = "__password__"}, {filter = "creditcard", replacement = "__ccnumber__"}];
// filter = [{filter = "password", replacement = "__password__"}, {filter = "creditcard", replacement = "__ccnumber__"}];
// contentFilter = createObject("nz.co.ventego-creative.raygun4cfml.RaygunContentFilter").init(filter);
//
// raygun = createObject("component","nz.co.ventego-creative.raygun4cfml.RaygunClient").init(
// apiKey = variables.RAYGUNAPIKEY,
// contentFilter = contentFilter
// );
//
// result = raygun.send(error)
// result = raygun.send(error)
Expand All @@ -46,26 +46,26 @@ limitations under the License.
// apiKey = variables.RAYGUNAPIKEY
// );
//
// result = raygun.send(error)
// result = raygun.send(error)
// 3. Sending custom data (NEW way of doing it)
// 3. Sending custom data (NEW way of doing it)
//
// Sample with passing in session and params data structures (error is the CF error structure provided to the error template(s), variables.RAYGUNAPIKEY is the Raygun.io API key)
//
// customUserDataStruct = {"session" = {"memberID" = "5747854", "memberFirstName" = "Kai"}, "params" = {"currentAction" = "IwasDoingThis", "justAnotherParam" = "test"}};
// customUserData = createObject("nz.co.ventego-creative.raygun4cfml.RaygunUserCustomData").init(customUserDataStruct);
//
//
// raygun = createObject("component","nz.co.ventego-creative.raygun4cfml.RaygunClient").init(
// apiKey = variables.RAYGUNAPIKEY
// );
//
// result = raygun.send(issueDataStruct=error,userCustomData=customUserData);
// 4. Sending tags
//
// result = raygun.send(issueDataStruct=error,userCustomData=customUserData);
// 4. Sending tags
//
// Sample with passing in tags (error is the CF error structure provided to the error template(s), variables.RAYGUNAPIKEY is the Raygun.io API key)
//
Expand All @@ -74,12 +74,12 @@ limitations under the License.
// raygun = createObject("component","nz.co.ventego-creative.raygun4cfml.RaygunClient").init(
// apiKey = variables.RAYGUNAPIKEY
// );
//
// result = raygun.send(issueDataStruct=error,tags=tags);
// 5. Sending user information
//
// result = raygun.send(issueDataStruct=error,tags=tags);
// 5. Sending user information
//
// Sample with passing in user information (error is the CF error structure provided to the error template(s), variables.RAYGUNAPIKEY is the Raygun.io API key)
//
Expand All @@ -88,8 +88,8 @@ limitations under the License.
// raygun = createObject("component","nz.co.ventego-creative.raygun4cfml.RaygunClient").init(
// apiKey = variables.RAYGUNAPIKEY
// );
//
// result = raygun.send(issueDataStruct=error,user=userIdentifier);
//
// result = raygun.send(issueDataStruct=error,user=userIdentifier);
</cfscript>


Loading

0 comments on commit edd82d4

Please sign in to comment.