} catch (InterruptedException e) { InternalErrorMessage.send(project).cacheLockTimeoutError( new ErrorEvent<>(new VcsInterruptedException(e))); return null; } catch (P4CommandRunner.ServerResultException e) {
@Override public void cacheLockTimeoutError(@NotNull ErrorEvent<VcsInterruptedException> t) { simpleError(t.getMessage(), "P4 Cache Access Timed Out"); LOG.warn(t.getError()); } });
@Override public void cancelled(@NotNull ErrorEvent<CancellationException> e) { simpleInfo( P4Bundle.message("user-error.cancelled.message"), P4Bundle.message("user-error.cancelled.title")); LOG.info(e.getError()); } });
public static void sendDisconnectCausedError(@NotNull Project project, @NotNull ConnectionException e) { if (canSendMessage(project)) { project.getMessageBus().syncPublisher(TOPIC).disconnectCausedError(new ErrorEvent<>(e)); } }
@Override public void disconnectCausedError(@NotNull ErrorEvent<Exception> e) { simpleWarning("Disconnection from server caused problem: " + e.getMessage(), "Disconnected from Perforce Server Error"); LOG.warn(e.getError()); }
public static void sendDisconnectCausedError(@NotNull Project project, @NotNull AccessException e) { if (canSendMessage(project)) { project.getMessageBus().syncPublisher(TOPIC).disconnectCausedError(new ErrorEvent<>(e)); } }
@Override public void charsetTranslationError(@NotNull ErrorEvent<ClientError> e) { simpleWarning("Problem : " + e.getMessage(), "Disconnected from Perforce Server Error"); LOG.warn(e.getError()); } });
public static void sendCharsetTranslationError(@NotNull Project project, @NotNull ClientError e) { if (canSendMessage(project)) { project.getMessageBus().syncPublisher(TOPIC).charsetTranslationError(new ErrorEvent<>(e)); } }
@Override public void internalError(@NotNull ErrorEvent<Throwable> t) { simpleError("Internal error: " + t.getMessage(), "P4 Plugin Error"); LOG.warn(t.getError()); }
InternalErrorMessage.send(project).p4ApiInternalError(new ErrorEvent<>( new Exception("Attempted to submit files that weren't open for edit/add: " + noChangelistFiles)));
@Override public void unexpectedError(@NotNull ErrorEvent<Throwable> t) { simpleError("Internal error: " + t.getMessage(), "P4 Plugin Error"); LOG.warn(t.getError()); }
private void loadClientConfigRoot(@NotNull Project project, @NotNull ClientConfigRoot root) { RootNode fileRoot = createRootNode(root); try { List<ActionChoice> pendingActions = CacheComponent.getInstance(project).getCachePending().copyActions(root.getClientConfig()) .collect(Collectors.toList()); fileRoot.pending.setPendingCount(pendingActions.size()); pendingActions.forEach((ac) -> { DefaultMutableTreeNode actionNode = new DefaultMutableTreeNode(ac); fileRoot.pendingNode.add(actionNode); // File information on an action is static. for (FilePath affectedFile : ac.getAffectedFiles()) { actionNode.add(new DefaultMutableTreeNode(affectedFile)); } for (P4CommandRunner.ResultError previousExecutionProblem : ac.getPreviousExecutionProblems()) { actionNode.add(new DefaultMutableTreeNode(previousExecutionProblem)); } }); } catch (InterruptedException e) { InternalErrorMessage.send(project).cacheLockTimeoutError(new ErrorEvent<>(new VcsInterruptedException(e))); } }
@Override public void p4ApiInternalError(@NotNull ErrorEvent<Throwable> t) { simpleError("Internal error: " + t.getMessage(), "P4 Plugin Error"); LOG.warn(t.getError()); }
@Override public void clientConfigurationRemoved(@NotNull ClientConfigRemovedMessage.Event event) { Collection<ClientConfig> activeConfigs = getActiveClientConfigs(); try { cache.cleanClientCache(activeConfigs); } catch (InterruptedException e) { InternalErrorMessage.send(project).cacheLockTimeoutError(new ErrorEvent<>(new VcsInterruptedException( SERVER_CACHE_TIMEOUT_MESSAGE, e))); } } }
@NotNull public static Map<ClientServerRef, P4ChangelistId> getActiveChangelistIds(@NotNull Project project) { LocalChangeList defaultIdeChangeList = ChangeListManager.getInstance(project).getDefaultChangeList(); Map<ClientServerRef, P4ChangelistId> ret = new HashMap<>(); try { CacheComponent.getInstance(project).getServerOpenedCache().first .getP4ChangesFor(defaultIdeChangeList) .forEach((id) -> ret.put(id.getClientServerRef(), id)); } catch (InterruptedException e) { InternalErrorMessage.send(project).cacheLockTimeoutError(new ErrorEvent<>(new VcsInterruptedException(e))); } return ret; }
private void reportCacheWaitError(InterruptedException e) { if (project == null) { LOG.warn(CACHE_WAIT_ERROR_MESSAGE, e); } else { InternalErrorMessage.send(project).cacheLockTimeoutError(new ErrorEvent<>(new VcsInterruptedException( CACHE_WAIT_ERROR_MESSAGE, e))); } }
@Nullable @Override public ProjectCacheStore.State getState() { try { return projectCache.getState(); } catch (InterruptedException e) { if (project != null) { InternalErrorMessage.send(project).cacheLockTimeoutError(new ErrorEvent<>( new VcsInterruptedException(SERIALIZE_CACHE_TIMEOUT_MESSAGE, e))); } else { LOG.warn(SERIALIZE_CACHE_TIMEOUT_MESSAGE, e); } return null; } }
@Override public void clientActionUpdate(@NotNull ClientActionMessage.Event event) { if (LOG.isDebugEnabled()) { LOG.debug("Caching action " + event.getAction()); } try { handleClientAction(event); } catch (InterruptedException e) { InternalErrorMessage.send(project).cacheLockTimeoutError(new ErrorEvent<>(new VcsInterruptedException( SERVER_CACHE_TIMEOUT_MESSAGE, e))); } }
@Override public void jobUpdate(@NotNull JobCacheMessage.Event event) { try { cache.write(event.getServerName(), (store) -> store.addJob(event.getJob())); } catch (InterruptedException e) { InternalErrorMessage.send(project).cacheLockTimeoutError(new ErrorEvent<>(new VcsInterruptedException( SERVER_CACHE_TIMEOUT_MESSAGE, e))); } }
@Override public void jobSpecUpdate(@NotNull JobSpecCacheMessage.Event event) { try { cache.write(event.getServerName(), (store) -> store.setJobSpec(event.getJobSpec())); } catch (InterruptedException e) { InternalErrorMessage.send(project).cacheLockTimeoutError(new ErrorEvent<>(new VcsInterruptedException( SERVER_CACHE_TIMEOUT_MESSAGE, e))); } }