@@ -31,9 +31,10 @@ impl Backend for Pprof<'_> {
3131 fn initialize ( & mut self , sample_rate : i32 ) -> Result < ( ) > {
3232 // Check if Backend is Uninitialized
3333 if self . state != State :: Uninitialized {
34- return Err ( crate :: error:: PyroscopeError {
35- msg : String :: from ( "Pprof Backend is already Initialized" ) ,
36- } ) ;
34+ //return Err(crate::error::PyroscopeError {
35+ //msg: String::from("Pprof Backend is already Initialized"),
36+ //});
37+ return Err ( crate :: error:: PyroscopeError :: default ( ) ) ;
3738 }
3839
3940 // Construct a ProfilerGuardBuilder
@@ -50,9 +51,10 @@ impl Backend for Pprof<'_> {
5051 fn start ( & mut self ) -> Result < ( ) > {
5152 // Check if Backend is Ready
5253 if self . state != State :: Ready {
53- return Err ( crate :: error:: PyroscopeError {
54- msg : String :: from ( "Pprof Backend is not Ready" ) ,
55- } ) ;
54+ //return Err(crate::error::PyroscopeError {
55+ //msg: String::from("Pprof Backend is not Ready"),
56+ //});
57+ return Err ( crate :: error:: PyroscopeError :: default ( ) ) ;
5658 }
5759
5860 self . guard = Some ( self . inner_builder . as_ref ( ) . unwrap ( ) . clone ( ) . build ( ) ?) ;
@@ -66,9 +68,11 @@ impl Backend for Pprof<'_> {
6668 fn stop ( & mut self ) -> Result < ( ) > {
6769 // Check if Backend is Running
6870 if self . state != State :: Running {
69- return Err ( crate :: error:: PyroscopeError {
70- msg : String :: from ( "Pprof Backend is not Running" ) ,
71- } ) ;
71+ //return Err(crate::error::PyroscopeError {
72+ //msg: String::from("Pprof Backend is not Running"),
73+ //});
74+
75+ return Err ( crate :: error:: PyroscopeError :: default ( ) ) ;
7276 }
7377
7478 // drop the guard
@@ -83,9 +87,10 @@ impl Backend for Pprof<'_> {
8387 fn report ( & mut self ) -> Result < Vec < u8 > > {
8488 // Check if Backend is Running
8589 if self . state != State :: Running {
86- return Err ( crate :: error:: PyroscopeError {
87- msg : String :: from ( "Pprof Backend is not Running" ) ,
88- } ) ;
90+ //return Err(crate::error::PyroscopeError {
91+ //msg: String::from("Pprof Backend is not Running"),
92+ //});
93+ return Err ( crate :: error:: PyroscopeError :: default ( ) ) ;
8994 }
9095
9196 let mut buffer = Vec :: new ( ) ;
0 commit comments