mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-12 05:20:35 +01:00
[PR #1104] [MERGED] Use try..catch to set encoding in WireMockConsoleLogger #1230
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/wiremock/WireMock.Net/pull/1104
Author: @asherber
Created: 5/17/2024
Status: ✅ Merged
Merged: 5/17/2024
Merged by: @StefH
Base:
master← Head:console-encoding📝 Commits (1)
eccff02Use try..catch to set encoding in WireMockConsoleLogger📊 Changes
1 file changed (+5 additions, -1 deletions)
View changed files
📝
src/WireMock.Net/Logging/WireMockConsoleLogger.cs(+5 -1)📄 Description
In Linqpad, the "console" is just a facade over web browser output, so calling
Console.OutputEncoding = System.Text.Encoding.UTF8in the constructor forWireMockConsoleLoggerthrows an exception.This PR adds a
try..catchblock to that code, so that the logger can be used in Linqpad (and any other non-standard consoles).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.