As noted by @coreykn on the original PR, the error handling for WP filesystem errors was previously a) treating $wp_filesystem as a WP_Error object instead of $wp_filesystem->errors and b) referencing a non-existent $wp_error variable.
This PR updates the error handling to consistently use $wp_filesystem->errors, causing a RuntimeException to be be thrown for [first, if multiple errors are present] error within the $wp->filesystem->errors object.
As noted by @coreykn on the original PR, the error handling for WP filesystem errors was previously a) treating
$wp_filesystem
as aWP_Error
object instead of$wp_filesystem->errors
and b) referencing a non-existent$wp_error
variable.This PR updates the error handling to consistently use
$wp_filesystem->errors
, causing aRuntimeException
to be be thrown for [first, if multiple errors are present] error within the$wp->filesystem->errors
object.