get rid of deprecated Throwables.propagateIfInstanceOf

This commit is contained in:
Vladimir Krivosheev
2019-04-03 09:40:02 +02:00
parent 025232e99f
commit 10d3affbe3
@@ -1,21 +1,6 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.util.download.impl;
import com.google.common.base.Throwables;
import com.google.common.util.concurrent.AtomicDouble;
import com.intellij.concurrency.SensitiveProgressWrapper;
import com.intellij.ide.IdeBundle;
@@ -214,8 +199,12 @@ public class FileDownloaderImpl implements FileDownloader {
throw new ProcessCanceledException();
}
catch (ExecutionException e) {
Throwables.propagateIfInstanceOf(e.getCause(), IOException.class);
Throwables.propagateIfInstanceOf(e.getCause(), ProcessCanceledException.class);
if (e.getCause() instanceof IOException) {
throw ((IOException)e.getCause());
}
if (e.getCause() instanceof ProcessCanceledException) {
throw ((ProcessCanceledException)e.getCause());
}
LOG.error(e);
}
}