public Test GetTestDetails(int id) { Test existingTest = new Test(); try { existingTest = _test_object.GetTestDetails(id); if (existingTest != null) { return(existingTest); } else { throw new OASCustomException("Null data encountered."); } } catch (SqlException sqlex) { log.Error(sqlex); } catch (OASCustomException customex) { log.Error(customex.Message); } catch (Exception ex) { log.Error(ex.Message); } return(existingTest); }