New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide LastErrors property in the ScriptSession to indicate errors rather than logging #559

Closed
michaellwest opened this Issue Jan 2, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@michaellwest
Member

michaellwest commented Jan 2, 2016

Making updates to ensure that when a script is invalid it will get logged.

@michaellwest michaellwest self-assigned this Jan 2, 2016

@michaellwest michaellwest added this to the 4.0 milestone Jan 2, 2016

@michaellwest

This comment has been minimized.

Member

michaellwest commented Jan 2, 2016

The following script

Invoke-RemoteScript -Session $session -ScriptBlock {
        [int]$a = 1
        $a -is [Sitecore.Kittens]
}

returns this through SPE Remoting

Unable to find type [Sitecore.Kittens].
At line:4 char:9
+         $a -is [Sitecore.Kittens]
+         ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Sitecore.Kittens:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

Use the LastErrors property in ScriptSession to get the error messages if you wish to write them to a log.

michaellwest added a commit that referenced this issue Jan 2, 2016

@michaellwest michaellwest changed the title from Invalid script errors are not properly logged to Provide LastError property in the ScriptSession to indicate errors rather than logging Jan 3, 2016

@AdamNaj

This comment has been minimized.

Member

AdamNaj commented Jan 11, 2016

If errors are found in the output stream they are logged on the Debug level not to clutter the logs by default.

@AdamNaj AdamNaj closed this Jan 11, 2016

AdamNaj added a commit that referenced this issue Jan 11, 2016

@michaellwest michaellwest changed the title from Provide LastError property in the ScriptSession to indicate errors rather than logging to Provide LastErrors property in the ScriptSession to indicate errors rather than logging Jan 15, 2016

@michaellwest michaellwest removed their assignment May 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment