{"id":13513851,"url":"https://github.com/jchristopherson/ferror","last_synced_at":"2026-03-04T09:01:50.669Z","repository":{"id":46312159,"uuid":"92594386","full_name":"jchristopherson/ferror","owner":"jchristopherson","description":"A library to assist with error handling in Fortran projects.","archived":false,"fork":false,"pushed_at":"2025-07-31T16:07:47.000Z","size":1192,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-31T19:03:54.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jchristopherson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-27T11:25:05.000Z","updated_at":"2024-02-09T06:12:33.000Z","dependencies_parsed_at":"2024-01-23T14:58:44.782Z","dependency_job_id":"a9470631-9e79-49ec-b8bb-0375208fafa0","html_url":"https://github.com/jchristopherson/ferror","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/jchristopherson/ferror","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristopherson%2Fferror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristopherson%2Fferror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristopherson%2Fferror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristopherson%2Fferror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchristopherson","download_url":"https://codeload.github.com/jchristopherson/ferror/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristopherson%2Fferror/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30076935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T05:00:38.738Z","updated_at":"2026-03-04T09:01:50.657Z","avatar_url":"https://github.com/jchristopherson.png","language":"Fortran","funding_links":[],"categories":["Dependencies"],"sub_categories":[],"readme":"# ferror\nA library to assist with error handling in Fortran projects.\n\n## Status\n![Build Status](https://github.com/jchristopherson/ferror/actions/workflows/cmake.yml/badge.svg)\n[![Actions Status](https://github.com/jchristopherson/ferror/workflows/fpm/badge.svg)](https://github.com/jchristopherson/ferror/actions)\n\n## Documentation\nThe documentation can be found [here](https://jchristopherson.github.io/ferror/).\n\n## Usage\n\n```fortran\nprogram example\n    use ferror\n    use, intrinsic :: iso_fortran_env, only : int32\n    implicit none\n\n    ! Variables\n    type(errors) :: err_mgr\n\n    ! Ensure the error reporting doesn't terminate the application.  The default\n    ! behavior terminates the application.\n    call err_mgr%set_exit_on_error(.false.)\n\n    ! Don't print the error message to the command line.  The default behavior\n    ! prints the error information to the command line.\n    call err_mgr%set_suppress_printing(.true.)\n\n    ! Call the routine that causes the error\n    call causes_error(err_mgr)\n\n    ! Print the error information\n    print '(A)', \"An error occurred in the following subroutine: \" // \u0026\n        err_mgr%get_error_fcn_name()\n    print '(A)', \"The error message is: \" // err_mgr%get_error_message()\n    print '(AI0)', \"The error code is: \", err_mgr%get_error_flag()\ncontains\n\n! The purpose of this subroutine is to simply trigger an error condition.\nsubroutine causes_error(err)\n    ! Arguments\n    class(errors), intent(inout) :: err\n\n    ! Define an error flag\n    integer(int32), parameter :: error_flag = 200\n\n    ! Trigger the error condition\n    call err%report_error(\u0026\n        \"causes_error\", \u0026                   ! The subroutine or function name\n        \"This is a test error message.\", \u0026  ! The error message.\n        error_flag)                         ! The error flag\nend subroutine\n\nend program\n```\nThe above program produces the following output.\n```text\nAn error occurred in the following subroutine: causes_error\nThe error message is: This is a test error message.\nThe error code is: 200\n```\n\n## C Usage\n```c\n#include \u003cstdio.h\u003e\n#include \"ferror.h\"\n\nvoid causes_error(error_handler *err);\n\n\nint main(void) {\n    // Variables\n    error_handler err_mgr;\n    char fname[256], msg[256];\n    int flag, fnamelength = 256, msglength = 256;\n\n    // Initialization\n    alloc_error_handler(\u0026err_mgr);\n\n    // Ensure the error reporting doesn't terminate the application\n    set_exit_on_error(\u0026err_mgr, false);\n\n    // Don't print the error message to the command line\n    set_suppress_printing(\u0026err_mgr, true);\n\n    // Call the routine that causes the error\n    causes_error(\u0026err_mgr);\n\n    // Retrieve the error information\n    get_error_fcn_name(\u0026err_mgr, fname, \u0026fnamelength);\n    get_error_message(\u0026err_mgr, msg, \u0026msglength);\n    flag = get_error_flag(\u0026err_mgr);\n\n    // Print the error information\n    printf(\"An error occurred in the following subroutine: %s\\nThe error message is: %s\\nThe error code is: %i\\n\",\n        fname, msg, flag);\n\n    // End\n    free_error_handler(\u0026err_mgr);\n    return 0;\n}\n\nvoid causes_error(error_handler *err) {\n    report_error(err,                       // The error_handler object\n        \"causes_error\",                     // The function name\n        \"This is a test error message.\",    // The error message\n        200);                               // The error flag\n}\n```\nThe above program produces the following output.\n```text\nAn error occurred in the following subroutine: causes_error\nThe error message is: This is a test error message.\nThe error code is: 200\n```\n\n## Compiling\n[CMake](https://cmake.org/) is the preferred build system for this library. \nTo configure, first navigate to the project directory and then issue the following command. \n```txt\ncmake -B build -DCMAKE_BUILD_TYPE=Release\n```\nTo build the C API:\n```txt\ncmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_FERROR_C_API=TRUE\n```\nIf testing is to be included then:\n```txt\ncmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=TRUE\n```\nor\n```txt\ncmake -B \"build\" -DCMAKE_BUILD_TYPE=Release -DBUILD_FERROR_C_API=TRUE -DBUILD_TESTING=TRUE\n```\nTo build:\n```txt\ncmake --build build\n```\nFinally, to run the tests:\n```txt\nctest --test-dir build/test\n```\n\n\n[Meson](https://mesonbuild.com/index.html) can also be used to build this library.  See [this](https://mesonbuild.com/Quick-guide.html) quick start guid on how to use Meson.\n\n[FPM](https://github.com/fortran-lang/fpm) can also be used to build this library using the provided fpm.toml.\n```txt\nfpm build\n```\nThe FERROR library can be used within your FPM project by adding the following to your fpm.toml file.\n```\n[dependencies]\nferror = { git = \"https://github.com/jchristopherson/ferror\" }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristopherson%2Fferror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchristopherson%2Fferror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristopherson%2Fferror/lists"}