PHP | 에러 감지 try + catch

|
try {
    $error = new WP_Error( 'custom-error', '이거 에러임' );
    if (is_wp_error( $error )) {
        $error_message = $error->get_error_message();
        throw new Exception( $error_message );
    }
} catch ( Exception $e) {
    echo $e
}

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

클릭하여 복사