@@ -126,7 +126,7 @@ public function __construct(
126126 $ this ->distinctIdsFeatureFlagsReported = new SizeLimitedHash (SIZE_LIMIT );
127127 $ this ->flagsEtag = null ;
128128
129- ErrorTrackingRegistrar ::configure ($ this , $ options );
129+ ExceptionCapture ::configure ($ this , $ options[ ' error_tracking ' ] ?? [] );
130130
131131 // Populate featureflags and grouptypemapping if possible
132132 if (
@@ -205,16 +205,19 @@ public function captureException(
205205 $ distinctId = Uuid::v4 ();
206206 }
207207
208- $ exceptionList = $ this ->buildExceptionList ($ exception );
209- if ($ exceptionList === null ) {
208+ $ errorTrackingConfig = $ this ->options ['error_tracking ' ] ?? [];
209+ $ maxFrames = max (0 , (int ) ($ errorTrackingConfig ['max_frames ' ] ?? 20 ));
210+
211+ $ exceptionList = ExceptionPayloadBuilder::buildExceptionList ($ exception , $ maxFrames );
212+ if (empty ($ exceptionList )) {
210213 return false ;
211214 }
212215
213216 $ properties = array_merge (
214217 $ additionalProperties ,
215218 [
216219 '$exception_list ' => $ exceptionList ,
217- '$exception_handled ' => ExceptionCapture ::getPrimaryHandled ($ exceptionList ),
220+ '$exception_handled ' => ExceptionPayloadBuilder ::getPrimaryHandled ($ exceptionList ),
218221 ]
219222 );
220223
@@ -921,22 +924,6 @@ public function flush()
921924 return true ;
922925 }
923926
924- /**
925- * @param \Throwable|string $exception
926- * @return array|null
927- */
928- private function buildExceptionList (\Throwable |string $ exception ): ?array
929- {
930- ExceptionCapture::configure ($ this ->options );
931-
932- $ exceptionList = ExceptionCapture::buildParsedException ($ exception );
933- if ($ exceptionList === null ) {
934- return null ;
935- }
936-
937- return ExceptionCapture::normalizeExceptionList ($ exceptionList );
938- }
939-
940927 /**
941928 * Formats a timestamp by making sure it is set
942929 * and converting it to iso8601.
0 commit comments