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 #1

Updated by Exception about 13 years ago

cool, jemand der sich den source ansieht. aber bleib mit bitte mit templates vom leib! der mechanismus heisst 'generics' ;)

Actions #2

Updated by LukyLuke about 13 years ago

template <typename T>
class Response
{
public:
  Response(T answer) { std::cout << answer << std::endl; };
};

Response<std::string> resp(" 

Mache ich gerne, wie schon mal gesagt ;)
Und dabei habe ich schon das ein oder andere lustige Konstrukt und if-Treppchen gefunden.
Aber über Eleganz und Schönheit beim Coden lässt sich ja wunderbar streiten :)
Einen C++ und Qt Parser/Deserializer für die Zertifikate habe ich schon nachgebaut - nur noch nicht als Factory
");
Actions #3

Updated by Exception almost 12 years ago

  • Tracker changed from 2 to Bug / Feature
  • Status changed from New to Needs Work
Actions #4

Updated by Exception almost 12 years ago

  • Category set to Usability
  • Target version changed from Backlog to PiVote 1.3.2.0
  • Request Type set to Feature Request
  • Affected Program set to All
  • Affected Users set to All

To be fixed.

Actions #5

Updated by Exception almost 12 years ago

  • Status changed from Needs Work to Done
  • % Done changed from 0 to 100

Fixed.

Actions #6

Updated by admin almost 12 years ago

  • Assignee changed from Exception to LukyLuke

Automaticaclly enforce assigned-to to the author of the ticket

Actions #7

Updated by admin almost 12 years ago

  • Due date set to 12 March 2013

Automatically enforce due date for Low Priority after 60 days in the future

Actions #8

Updated by LukyLuke almost 12 years ago

  • Status changed from Done to Closed
Actions

Also available in: Atom PDF