View source: R/format_error_message.R
format_error_message | R Documentation |
Format Error Message for Google Error Reporting
format_error_message( message = "Error description", service = "My Service", version = "0.0.1", method = "GET", url = "https://example.com", user_agent = "", referrer = "", response_status_code = "500", remote_ip = "192.178.0.0.1", user_id = "UserID", filepath = "/", line_number = 0, function_name = "my_function" )
message |
the error message you want in the logs |
service |
the name of your service |
version |
the version of the service |
method |
the http method used for hte call |
url |
hte unique resource identifier that was called |
user_agent |
the user agente identifier |
referrer |
the referrer to the service |
response_status_code |
http response code |
remote_ip |
remote ip |
user_id |
user id |
filepath |
filepath of the code where the error originates |
line_number |
line number where the error originates |
function_name |
function name where the error originates |
message object, a list to be formated as JSON in the error report body
## Not run: message <- format_error_message() message$serviceContext$service <- "A demo service" message$serviceContext$version <- "v0.3.4" ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.