From 10f769b9c8a542271799fcb2acce5d5777d2f947 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 19 Jul 2024 23:21:56 -0700 Subject: [PATCH] [Geneva Exporter] Allocate exception from stack instead of heap (#470) --- .../opentelemetry/exporters/geneva/geneva_logger_exporter.h | 2 +- .../opentelemetry/exporters/geneva/geneva_tracer_exporter.h | 2 +- exporters/fluentd/src/log/fluentd_exporter.cc | 2 +- exporters/fluentd/src/trace/fluentd_exporter.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exporters/fluentd/include/opentelemetry/exporters/geneva/geneva_logger_exporter.h b/exporters/fluentd/include/opentelemetry/exporters/geneva/geneva_logger_exporter.h index 8121703c6..791f60444 100644 --- a/exporters/fluentd/include/opentelemetry/exporters/geneva/geneva_logger_exporter.h +++ b/exporters/fluentd/include/opentelemetry/exporters/geneva/geneva_logger_exporter.h @@ -37,7 +37,7 @@ static inline bool InitializeGenevaExporter( const GenevaExporterOptions options return true; } else { #if defined(__EXCEPTIONS) - throw new std::runtime_error("Invalid endpoint! Unix domain socket should have unix:// as url-scheme"); + throw std::runtime_error("Invalid endpoint! Unix domain socket should have unix:// as url-scheme"); #endif return false; } diff --git a/exporters/fluentd/include/opentelemetry/exporters/geneva/geneva_tracer_exporter.h b/exporters/fluentd/include/opentelemetry/exporters/geneva/geneva_tracer_exporter.h index c52e14186..9161c5d9d 100644 --- a/exporters/fluentd/include/opentelemetry/exporters/geneva/geneva_tracer_exporter.h +++ b/exporters/fluentd/include/opentelemetry/exporters/geneva/geneva_tracer_exporter.h @@ -41,7 +41,7 @@ static inline bool InitializeGenevaExporter( const GenevaExporterOptions options return true; } else { #if defined(__EXCEPTIONS) - throw new std::runtime_error("Invalid endpoint! Unix domain socket should have unix:// as url-scheme"); + throw std::runtime_error("Invalid endpoint! Unix domain socket should have unix:// as url-scheme"); #endif return false; } diff --git a/exporters/fluentd/src/log/fluentd_exporter.cc b/exporters/fluentd/src/log/fluentd_exporter.cc index 7efb106d5..1789c296d 100644 --- a/exporters/fluentd/src/log/fluentd_exporter.cc +++ b/exporters/fluentd/src/log/fluentd_exporter.cc @@ -213,7 +213,7 @@ bool FluentdExporter::Initialize() { else { #if defined(__EXCEPTIONS) // Customers MUST specify valid end-point configuration - throw new std::runtime_error("Invalid endpoint!"); + throw std::runtime_error("Invalid endpoint!"); #endif return false; } diff --git a/exporters/fluentd/src/trace/fluentd_exporter.cc b/exporters/fluentd/src/trace/fluentd_exporter.cc index 35950d33d..f01bd8217 100644 --- a/exporters/fluentd/src/trace/fluentd_exporter.cc +++ b/exporters/fluentd/src/trace/fluentd_exporter.cc @@ -181,7 +181,7 @@ bool FluentdExporter::Initialize() { else { #if defined(__EXCEPTIONS) // Customers MUST specify valid end-point configuration - throw new std::runtime_error("Invalid endpoint!"); + throw std::runtime_error("Invalid endpoint!"); #endif return false; }