400, ApiException::INVALID_KEY => 401, ApiException::NO_CREDITS => 402, ApiException::RATE_LIMITED => 429, ApiException::INVALID_INPUT => 422, ); return new \WP_Error( 'translateplus_' . $e->reason(), $e->getMessage(), array( 'status' => $map[ $e->reason() ] ?? 502 ) ); } }