ncdaperr.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*********************************************************************
  2. * Copyright 1993, UCAR/Unidata
  3. * See netcdf/COPYRIGHT file for copying and redistribution conditions.
  4. * $Header: /upc/share/CVS/netcdf-3/libncdap3/ncdaperr.c,v 1.10 2009/09/23 22:26:08 dmh Exp $
  5. *********************************************************************/
  6. #include "ncdap3.h"
  7. NCerror
  8. ocerrtoncerr(OCerror ocerr)
  9. {
  10. if(ocerr >= 0) return ocerr; /* really a system error*/
  11. switch (ocerr) {
  12. case OC_NOERR: return NC_NOERR;
  13. case OC_EBADID: return NC_EBADID;
  14. case OC_ECHAR: return NC_ECHAR;
  15. case OC_EDIMSIZE: return NC_EDIMSIZE;
  16. case OC_EEDGE: return NC_EEDGE;
  17. case OC_EINVAL: return NC_EINVAL;
  18. case OC_EINVALCOORDS: return NC_EINVALCOORDS;
  19. case OC_ENOMEM: return NC_ENOMEM;
  20. case OC_ENOTVAR: return NC_ENOTVAR;
  21. case OC_EPERM: return NC_EPERM;
  22. case OC_ESTRIDE: return NC_ESTRIDE;
  23. case OC_EDAP: return NC_EDAP;
  24. case OC_EXDR: return NC_EDAP;
  25. case OC_ECURL: return NC_EIO;
  26. case OC_EBADURL: return NC_EDAPURL;
  27. case OC_EBADVAR: return NC_EDAP;
  28. case OC_EOPEN: return NC_EIO;
  29. case OC_EIO: return NC_EIO;
  30. case OC_ENODATA: return NC_ENODATA;
  31. case OC_EDAPSVC: return NC_EDAPSVC;
  32. case OC_ENAMEINUSE: return NC_ENAMEINUSE;
  33. case OC_EDAS: return NC_EDAS;
  34. case OC_EDDS: return NC_EDDS;
  35. case OC_EDATADDS: return NC_EDATADDS;
  36. case OC_ERCFILE: return NC_EDAP;
  37. case OC_ENOFILE: return NC_ECANTREAD;
  38. default: break;
  39. }
  40. return NC_EDAP; /* default;*/
  41. }