export function getErrorFromStackTrace ( stackTrace ) { const stringStackTrace = ( stackTrace || "" ) . toString ( ) ; const match = stringStackTrace . match ( /.*\s*$/g ) [ 0 ] ; const error = match . substring ( 0 , match . lastIndexOf ( ";" ) ) ; return error || stringStackTrace ; }