// GET: pony-challenge/Maze/GUID/print public HttpResponseMessage PrintAction(Guid mazeId) { string mazeString = String.Empty; try { if (mazeId != null && mazeId != Guid.Empty) { var maze = MemoryCacher.GetMazeFromCache(mazeId); mazeString = MazeHelper.PrintMazeAsHTML(maze); } else { HttpResponseException exception = CreateResponseException(HttpStatusCode.BadRequest, ERRORMESSAGE_MAZEID_INVALID); throw exception; } } catch (Exception ex) { HttpResponseException exception = CreateResponseException(HttpStatusCode.InternalServerError, ex.Message); throw exception; } return(Request.CreateResponse(HttpStatusCode.OK, mazeString)); }