Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2014 All Rights Reserved by the SDL Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -17,10 +17,11 @@
using System;
using System.Collections.Generic;
using System.Management.Automation;
using System.ServiceModel;
using Trisoft.ISHRemote.DocumentObj25ServiceReference;
using Trisoft.ISHRemote.Exceptions;
using Trisoft.ISHRemote.Objects;
using Trisoft.ISHRemote.Objects.Public;
using Trisoft.ISHRemote.Exceptions;
using Trisoft.ISHRemote.DocumentObj25ServiceReference;

namespace Trisoft.ISHRemote.Cmdlets.Annotation
{
Expand Down Expand Up @@ -364,11 +365,26 @@ protected override void ProcessRecord()
WriteVerbose("returned object count[" + returnedObjects.Count + "]");
WriteObject(IshSession, ISHType, returnedObjects.ConvertAll(x => (IshBaseObject)x), true);
}

catch (TrisoftAutomationException trisoftAutomationException)
{
ThrowTerminatingError(new ErrorRecord(trisoftAutomationException, base.GetType().Name, ErrorCategory.InvalidOperation, null));
}
catch (AggregateException aggregateException)
{
var flattenedAggregateException = aggregateException.Flatten();
WriteWarning(flattenedAggregateException.ToString());
ThrowTerminatingError(new ErrorRecord(flattenedAggregateException, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
catch (TimeoutException timeoutException)
{
WriteVerbose("TimeoutException Message[" + timeoutException.Message + "] StackTrace[" + timeoutException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(timeoutException, base.GetType().Name, ErrorCategory.OperationTimeout, null));
}
catch (CommunicationException communicationException)
{
WriteVerbose("CommunicationException Message[" + communicationException.Message + "] StackTrace[" + communicationException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(communicationException, base.GetType().Name, ErrorCategory.OperationStopped, null));
}
catch (Exception exception)
{
ThrowTerminatingError(new ErrorRecord(exception, base.GetType().Name, ErrorCategory.NotSpecified, null));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2014 All Rights Reserved by the SDL Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -17,9 +17,10 @@
using System;
using System.Collections.Generic;
using System.Management.Automation;
using System.ServiceModel;
using Trisoft.ISHRemote.Exceptions;
using Trisoft.ISHRemote.Objects;
using Trisoft.ISHRemote.Objects.Public;
using Trisoft.ISHRemote.Exceptions;

namespace Trisoft.ISHRemote.Cmdlets.Annotation
{
Expand Down Expand Up @@ -110,11 +111,26 @@ protected override void ProcessRecord()
WriteVerbose("returned object count[" + returnedObjects.Count + "]");
WriteObject(IshSession, ISHType, returnedObjects.ConvertAll(x => (IshBaseObject)x), true);
}

catch (TrisoftAutomationException trisoftAutomationException)
{
ThrowTerminatingError(new ErrorRecord(trisoftAutomationException, base.GetType().Name, ErrorCategory.InvalidOperation, null));
}
catch (AggregateException aggregateException)
{
var flattenedAggregateException = aggregateException.Flatten();
WriteWarning(flattenedAggregateException.ToString());
ThrowTerminatingError(new ErrorRecord(flattenedAggregateException, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
catch (TimeoutException timeoutException)
{
WriteVerbose("TimeoutException Message[" + timeoutException.Message + "] StackTrace[" + timeoutException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(timeoutException, base.GetType().Name, ErrorCategory.OperationTimeout, null));
}
catch (CommunicationException communicationException)
{
WriteVerbose("CommunicationException Message[" + communicationException.Message + "] StackTrace[" + communicationException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(communicationException, base.GetType().Name, ErrorCategory.OperationStopped, null));
}
catch (Exception exception)
{
ThrowTerminatingError(new ErrorRecord(exception, base.GetType().Name, ErrorCategory.NotSpecified, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.ServiceModel;
using Trisoft.ISHRemote.Exceptions;
using Trisoft.ISHRemote.Objects;
using Trisoft.ISHRemote.Objects.Public;
using Trisoft.ISHRemote.Exceptions;
using System.Linq;

namespace Trisoft.ISHRemote.Cmdlets.Annotation
{
Expand Down Expand Up @@ -161,6 +162,22 @@ protected override void ProcessRecord()
{
ThrowTerminatingError(new ErrorRecord(trisoftAutomationException, base.GetType().Name, ErrorCategory.InvalidOperation, null));
}
catch (AggregateException aggregateException)
{
var flattenedAggregateException = aggregateException.Flatten();
WriteWarning(flattenedAggregateException.ToString());
ThrowTerminatingError(new ErrorRecord(flattenedAggregateException, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
catch (TimeoutException timeoutException)
{
WriteVerbose("TimeoutException Message[" + timeoutException.Message + "] StackTrace[" + timeoutException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(timeoutException, base.GetType().Name, ErrorCategory.OperationTimeout, null));
}
catch (CommunicationException communicationException)
{
WriteVerbose("CommunicationException Message[" + communicationException.Message + "] StackTrace[" + communicationException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(communicationException, base.GetType().Name, ErrorCategory.OperationStopped, null));
}
catch (Exception exception)
{
ThrowTerminatingError(new ErrorRecord(exception, base.GetType().Name, ErrorCategory.NotSpecified, null));
Expand Down Expand Up @@ -255,15 +272,34 @@ protected override void EndProcessing()
WriteVerbose("returned object count[" + returnedObjects.Count + "]");
WriteObject(IshSession, ISHType, returnedObjects.ConvertAll(x => (IshBaseObject)x), true);
}

catch (TrisoftAutomationException trisoftAutomationException)
{
ThrowTerminatingError(new ErrorRecord(trisoftAutomationException, base.GetType().Name, ErrorCategory.InvalidOperation, null));
}
catch (AggregateException aggregateException)
{
var flattenedAggregateException = aggregateException.Flatten();
WriteWarning(flattenedAggregateException.ToString());
ThrowTerminatingError(new ErrorRecord(flattenedAggregateException, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
catch (TimeoutException timeoutException)
{
WriteVerbose("TimeoutException Message[" + timeoutException.Message + "] StackTrace[" + timeoutException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(timeoutException, base.GetType().Name, ErrorCategory.OperationTimeout, null));
}
catch (CommunicationException communicationException)
{
WriteVerbose("CommunicationException Message[" + communicationException.Message + "] StackTrace[" + communicationException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(communicationException, base.GetType().Name, ErrorCategory.OperationStopped, null));
}
catch (Exception exception)
{
ThrowTerminatingError(new ErrorRecord(exception, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
finally
{
base.EndProcessing();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2014 All Rights Reserved by the SDL Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,11 +16,12 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.ServiceModel;
using Trisoft.ISHRemote.Exceptions;
using Trisoft.ISHRemote.Objects;
using Trisoft.ISHRemote.Objects.Public;
using Trisoft.ISHRemote.Exceptions;
using System.Linq;

namespace Trisoft.ISHRemote.Cmdlets.Annotation
{
Expand Down Expand Up @@ -103,6 +104,22 @@ protected override void ProcessRecord()
{
ThrowTerminatingError(new ErrorRecord(trisoftAutomationException, base.GetType().Name, ErrorCategory.InvalidOperation, null));
}
catch (AggregateException aggregateException)
{
var flattenedAggregateException = aggregateException.Flatten();
WriteWarning(flattenedAggregateException.ToString());
ThrowTerminatingError(new ErrorRecord(flattenedAggregateException, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
catch (TimeoutException timeoutException)
{
WriteVerbose("TimeoutException Message[" + timeoutException.Message + "] StackTrace[" + timeoutException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(timeoutException, base.GetType().Name, ErrorCategory.OperationTimeout, null));
}
catch (CommunicationException communicationException)
{
WriteVerbose("CommunicationException Message[" + communicationException.Message + "] StackTrace[" + communicationException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(communicationException, base.GetType().Name, ErrorCategory.OperationStopped, null));
}
catch (Exception exception)
{
ThrowTerminatingError(new ErrorRecord(exception, base.GetType().Name, ErrorCategory.NotSpecified, null));
Expand Down Expand Up @@ -170,15 +187,34 @@ protected override void EndProcessing()

WriteVerbose("returned object count[0]");
}

catch (TrisoftAutomationException trisoftAutomationException)
{
ThrowTerminatingError(new ErrorRecord(trisoftAutomationException, base.GetType().Name, ErrorCategory.InvalidOperation, null));
}
catch (AggregateException aggregateException)
{
var flattenedAggregateException = aggregateException.Flatten();
WriteWarning(flattenedAggregateException.ToString());
ThrowTerminatingError(new ErrorRecord(flattenedAggregateException, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
catch (TimeoutException timeoutException)
{
WriteVerbose("TimeoutException Message[" + timeoutException.Message + "] StackTrace[" + timeoutException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(timeoutException, base.GetType().Name, ErrorCategory.OperationTimeout, null));
}
catch (CommunicationException communicationException)
{
WriteVerbose("CommunicationException Message[" + communicationException.Message + "] StackTrace[" + communicationException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(communicationException, base.GetType().Name, ErrorCategory.OperationStopped, null));
}
catch (Exception exception)
{
ThrowTerminatingError(new ErrorRecord(exception, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
finally
{
base.EndProcessing();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
using System;
using System.Collections.Generic;
using System.Management.Automation;
using System.ServiceModel;
using Trisoft.ISHRemote.Exceptions;
using Trisoft.ISHRemote.Objects;
using Trisoft.ISHRemote.Objects.Public;
using Trisoft.ISHRemote.Exceptions;

namespace Trisoft.ISHRemote.Cmdlets.Annotation
{
Expand Down Expand Up @@ -136,6 +137,22 @@ protected override void ProcessRecord()
{
ThrowTerminatingError(new ErrorRecord(trisoftAutomationException, base.GetType().Name, ErrorCategory.InvalidOperation, null));
}
catch (AggregateException aggregateException)
{
var flattenedAggregateException = aggregateException.Flatten();
WriteWarning(flattenedAggregateException.ToString());
ThrowTerminatingError(new ErrorRecord(flattenedAggregateException, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
catch (TimeoutException timeoutException)
{
WriteVerbose("TimeoutException Message[" + timeoutException.Message + "] StackTrace[" + timeoutException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(timeoutException, base.GetType().Name, ErrorCategory.OperationTimeout, null));
}
catch (CommunicationException communicationException)
{
WriteVerbose("CommunicationException Message[" + communicationException.Message + "] StackTrace[" + communicationException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(communicationException, base.GetType().Name, ErrorCategory.OperationStopped, null));
}
catch (Exception exception)
{
ThrowTerminatingError(new ErrorRecord(exception, base.GetType().Name, ErrorCategory.NotSpecified, null));
Expand Down Expand Up @@ -206,15 +223,34 @@ protected override void EndProcessing()
WriteVerbose("returned object count[" + returnedObjects.Count + "]");
WriteObject(IshSession, ISHType, returnedObjects.ConvertAll(x => (IshBaseObject)x), true);
}

catch (TrisoftAutomationException trisoftAutomationException)
{
ThrowTerminatingError(new ErrorRecord(trisoftAutomationException, base.GetType().Name, ErrorCategory.InvalidOperation, null));
}
catch (AggregateException aggregateException)
{
var flattenedAggregateException = aggregateException.Flatten();
WriteWarning(flattenedAggregateException.ToString());
ThrowTerminatingError(new ErrorRecord(flattenedAggregateException, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
catch (TimeoutException timeoutException)
{
WriteVerbose("TimeoutException Message[" + timeoutException.Message + "] StackTrace[" + timeoutException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(timeoutException, base.GetType().Name, ErrorCategory.OperationTimeout, null));
}
catch (CommunicationException communicationException)
{
WriteVerbose("CommunicationException Message[" + communicationException.Message + "] StackTrace[" + communicationException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(communicationException, base.GetType().Name, ErrorCategory.OperationStopped, null));
}
catch (Exception exception)
{
ThrowTerminatingError(new ErrorRecord(exception, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
finally
{
base.EndProcessing();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@

using System;
using System.Management.Automation;
using Trisoft.ISHRemote.Objects;
using Trisoft.ISHRemote.Objects.Public;
using System.ServiceModel;
using Trisoft.ISHRemote.Exceptions;
using Trisoft.ISHRemote.HelperClasses;
using Trisoft.ISHRemote.Objects;
using Trisoft.ISHRemote.Objects.Public;

namespace Trisoft.ISHRemote.Cmdlets.Application
{
Expand Down Expand Up @@ -60,14 +61,45 @@ protected override void BeginProcessing()
base.BeginProcessing();
}

protected override void ProcessRecord()
protected override void EndProcessing()
{
//Get the version of the application
WriteDebug($"Before IshSession.Application25.GetVersion()");
string version = IshSession.Application25.GetVersion();
WriteDebug($"After IshSession.Application25.GetVersion()");
IshVersion versionObject = new IshVersion(version);
WriteObject(versionObject);
try
{
//Get the version of the application
WriteDebug($"Before IshSession.Application25.GetVersion()");
string version = IshSession.Application25.GetVersion();
WriteDebug($"After IshSession.Application25.GetVersion()");
IshVersion versionObject = new IshVersion(version);
WriteObject(versionObject);
}
catch (TrisoftAutomationException trisoftAutomationException)
{
ThrowTerminatingError(new ErrorRecord(trisoftAutomationException, base.GetType().Name, ErrorCategory.InvalidOperation, null));
}
catch (AggregateException aggregateException)
{
var flattenedAggregateException = aggregateException.Flatten();
WriteWarning(flattenedAggregateException.ToString());
ThrowTerminatingError(new ErrorRecord(flattenedAggregateException, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
catch (TimeoutException timeoutException)
{
WriteVerbose("TimeoutException Message[" + timeoutException.Message + "] StackTrace[" + timeoutException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(timeoutException, base.GetType().Name, ErrorCategory.OperationTimeout, null));
}
catch (CommunicationException communicationException)
{
WriteVerbose("CommunicationException Message[" + communicationException.Message + "] StackTrace[" + communicationException.StackTrace + "]");
ThrowTerminatingError(new ErrorRecord(communicationException, base.GetType().Name, ErrorCategory.OperationStopped, null));
}
catch (Exception exception)
{
ThrowTerminatingError(new ErrorRecord(exception, base.GetType().Name, ErrorCategory.NotSpecified, null));
}
finally
{
base.EndProcessing();
}
}
}
}
Loading
Loading