Project

General

Profile

Actions

Bug / Feature #1988

closed

Wrong Exception-Message in "TSerializable Load<TSerializable>(string fileName)"

Added by LukyLuke about 13 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Usability
Target version:
Start date:
15 November 2011
Due date:
12 March 2013
% Done:

100%

Estimated time:
Request Type:
Feature Request
Affected Program:
All
Affected Users:
All

Description

File: pi-vote/Common/Serialization/Serializable.cs
Function: public static TSerializable Load<TSerializable>(string fileName)
Note: This function is templated, so it should throw a customized Exception and not only a "Certificate file not found" :)

public static TSerializable Load<TSerializable>(string fileName)

  where TSerializable : Serializable

{

  if (fileName == null)

    throw new ArgumentNullException("fileName");

  if (!File.Exists(fileName))

    throw new ArgumentException("Certificate file not found.");

  return Serializable.FromBinary<TSerializable>(File.ReadAllBytes(fileName));

}
Actions

Also available in: Atom PDF