Sha256: d02b51979cd4c56027fb8d99d67206a1de625f8e2b4b59298dd99e03eed8ac96
Contents?: true
Size: 757 Bytes
Versions: 329
Compression:
Stored size: 757 Bytes
Contents
using System; public static class ErrorHandling { public static void HandleErrorByThrowingException() { throw new Exception("An error occured."); } public static int? HandleErrorByReturningNullableType(string input) { int result; if (int.TryParse(input, out result)) { return result; } return null; } public static bool HandleErrorWithOutParam(string input, out int result) { return int.TryParse(input, out result); } public static void DisposableResourcesAreDisposedWhenExceptionIsThrown(IDisposable disposableObject) { using (disposableObject) { throw new Exception("An error occured."); } } }
Version data entries
329 entries across 329 versions & 1 rubygems