We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[feaLib] "fonttools feaLib" should error out, not continue
If there's a parse/build error when using the feaLib command line tool, we currently do this:

https://github.com/fonttools/fonttools/blob/445108f735b22a5ca37f669808d47906d024fe24/Lib/fontTools/feaLib/__main__.py#L69-L73

i.e. we save the font anyway and exit with status code 0.

My Makefiles and I think this is a terrible idea, and I would like to change it. Any objections / thoughts?



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `Lib/fontTools/feaLib/__main__.py`
Content:
```
1 from fontTools.ttLib import TTFont
2 from fontTools.feaLib.builder import addOpenTypeFeatures, Builder
3 from fontTools.feaLib.error import FeatureLibError
4 from fontTools import configLogger
5 from fontTools.misc.cliTools import makeOutputFileName
6 import sys
7 import argparse
8 import logging
9 
10 
11 log = logging.getLogger("fontTools.feaLib")
12 
13 
14 def main(args=None):
15     """Add features from a feature file (.fea) into a OTF font"""
16     parser = argparse.ArgumentParser(
17         description="Use fontTools to compile OpenType feature files (*.fea)."
18     )
19     parser.add_argument(
20         "input_fea", metavar="FEATURES", help="Path to the feature file"
21     )
22     parser.add_argument(
23         "input_font", metavar="INPUT_FONT", help="Path to the input font"
24     )
25     parser.add_argument(
26         "-o",
27         "--output",
28         dest="output_font",
29         metavar="OUTPUT_FONT",
30         help="Path to the output font.",
31     )
32     parser.add_argument(
33         "-t",
34         "--tables",
35         metavar="TABLE_TAG",
36         choices=Builder.supportedTables,
37         nargs="+",
38         help="Specify the table(s) to be built.",
39     )
40     parser.add_argument(
41         "-d",
42         "--debug",
43         action="store_true",
44         help="Add source-level debugging information to font.",
45     )
46     parser.add_argument(
47         "-v",
48         "--verbose",
49         help="increase the logger verbosity. Multiple -v " "options are allowed.",
50         action="count",
51         default=0,
52     )
53     parser.add_argument(
54         "--traceback", help="show traceback for exceptions.", action="store_true"
55     )
56     options = parser.parse_args(args)
57 
58     levels = ["WARNING", "INFO", "DEBUG"]
59     configLogger(level=levels[min(len(levels) - 1, options.verbose)])
60 
61     output_font = options.output_font or makeOutputFileName(options.input_font)
62     log.info("Compiling features to '%s'" % (output_font))
63 
64     font = TTFont(options.input_font)
65     try:
66         addOpenTypeFeatures(
67             font, options.input_fea, tables=options.tables, debug=options.debug
68         )
69     except FeatureLibError as e:
70         if options.traceback:
71             raise
72         log.error(e)
73     font.save(output_font)
74 
75 
76 if __name__ == "__main__":
77     sys.exit(main())
78
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/Lib/fontTools/feaLib/__main__.py b/Lib/fontTools/feaLib/__main__.py
--- a/Lib/fontTools/feaLib/__main__.py
+++ b/Lib/fontTools/feaLib/__main__.py
@@ -70,6 +70,7 @@
         if options.traceback:
             raise
         log.error(e)
+        sys.exit(1)
     font.save(output_font)

{"golden_diff": "diff --git a/Lib/fontTools/feaLib/__main__.py b/Lib/fontTools/feaLib/__main__.py\n--- a/Lib/fontTools/feaLib/__main__.py\n+++ b/Lib/fontTools/feaLib/__main__.py\n@@ -70,6 +70,7 @@\n         if options.traceback:\n             raise\n         log.error(e)\n+        sys.exit(1)\n     font.save(output_font)\n", "issue": "[feaLib] \"fonttools feaLib\" should error out, not continue\nIf there's a parse/build error when using the feaLib command line tool, we currently do this:\r\n\r\nhttps://github.com/fonttools/fonttools/blob/445108f735b22a5ca37f669808d47906d024fe24/Lib/fontTools/feaLib/__main__.py#L69-L73\r\n\r\ni.e. we save the font anyway and exit with status code 0.\r\n\r\nMy Makefiles and I think this is a terrible idea, and I would like to change it. Any objections / thoughts?\r\n\r\n\n", "before_files": [{"content": "from fontTools.ttLib import TTFont\nfrom fontTools.feaLib.builder import addOpenTypeFeatures, Builder\nfrom fontTools.feaLib.error import FeatureLibError\nfrom fontTools import configLogger\nfrom fontTools.misc.cliTools import makeOutputFileName\nimport sys\nimport argparse\nimport logging\n\n\nlog = logging.getLogger(\"fontTools.feaLib\")\n\n\ndef main(args=None):\n    \"\"\"Add features from a feature file (.fea) into a OTF font\"\"\"\n    parser = argparse.ArgumentParser(\n        description=\"Use fontTools to compile OpenType feature files (*.fea).\"\n    )\n    parser.add_argument(\n        \"input_fea\", metavar=\"FEATURES\", help=\"Path to the feature file\"\n    )\n    parser.add_argument(\n        \"input_font\", metavar=\"INPUT_FONT\", help=\"Path to the input font\"\n    )\n    parser.add_argument(\n        \"-o\",\n        \"--output\",\n        dest=\"output_font\",\n        metavar=\"OUTPUT_FONT\",\n        help=\"Path to the output font.\",\n    )\n    parser.add_argument(\n        \"-t\",\n        \"--tables\",\n        metavar=\"TABLE_TAG\",\n        choices=Builder.supportedTables,\n        nargs=\"+\",\n        help=\"Specify the table(s) to be built.\",\n    )\n    parser.add_argument(\n        \"-d\",\n        \"--debug\",\n        action=\"store_true\",\n        help=\"Add source-level debugging information to font.\",\n    )\n    parser.add_argument(\n        \"-v\",\n        \"--verbose\",\n        help=\"increase the logger verbosity. Multiple -v \" \"options are allowed.\",\n        action=\"count\",\n        default=0,\n    )\n    parser.add_argument(\n        \"--traceback\", help=\"show traceback for exceptions.\", action=\"store_true\"\n    )\n    options = parser.parse_args(args)\n\n    levels = [\"WARNING\", \"INFO\", \"DEBUG\"]\n    configLogger(level=levels[min(len(levels) - 1, options.verbose)])\n\n    output_font = options.output_font or makeOutputFileName(options.input_font)\n    log.info(\"Compiling features to '%s'\" % (output_font))\n\n    font = TTFont(options.input_font)\n    try:\n        addOpenTypeFeatures(\n            font, options.input_fea, tables=options.tables, debug=options.debug\n        )\n    except FeatureLibError as e:\n        if options.traceback:\n            raise\n        log.error(e)\n    font.save(output_font)\n\n\nif __name__ == \"__main__\":\n    sys.exit(main())\n", "path": "Lib/fontTools/feaLib/__main__.py"}], "after_files": [{"content": "from fontTools.ttLib import TTFont\nfrom fontTools.feaLib.builder import addOpenTypeFeatures, Builder\nfrom fontTools.feaLib.error import FeatureLibError\nfrom fontTools import configLogger\nfrom fontTools.misc.cliTools import makeOutputFileName\nimport sys\nimport argparse\nimport logging\n\n\nlog = logging.getLogger(\"fontTools.feaLib\")\n\n\ndef main(args=None):\n    \"\"\"Add features from a feature file (.fea) into a OTF font\"\"\"\n    parser = argparse.ArgumentParser(\n        description=\"Use fontTools to compile OpenType feature files (*.fea).\"\n    )\n    parser.add_argument(\n        \"input_fea\", metavar=\"FEATURES\", help=\"Path to the feature file\"\n    )\n    parser.add_argument(\n        \"input_font\", metavar=\"INPUT_FONT\", help=\"Path to the input font\"\n    )\n    parser.add_argument(\n        \"-o\",\n        \"--output\",\n        dest=\"output_font\",\n        metavar=\"OUTPUT_FONT\",\n        help=\"Path to the output font.\",\n    )\n    parser.add_argument(\n        \"-t\",\n        \"--tables\",\n        metavar=\"TABLE_TAG\",\n        choices=Builder.supportedTables,\n        nargs=\"+\",\n        help=\"Specify the table(s) to be built.\",\n    )\n    parser.add_argument(\n        \"-d\",\n        \"--debug\",\n        action=\"store_true\",\n        help=\"Add source-level debugging information to font.\",\n    )\n    parser.add_argument(\n        \"-v\",\n        \"--verbose\",\n        help=\"increase the logger verbosity. Multiple -v \" \"options are allowed.\",\n        action=\"count\",\n        default=0,\n    )\n    parser.add_argument(\n        \"--traceback\", help=\"show traceback for exceptions.\", action=\"store_true\"\n    )\n    options = parser.parse_args(args)\n\n    levels = [\"WARNING\", \"INFO\", \"DEBUG\"]\n    configLogger(level=levels[min(len(levels) - 1, options.verbose)])\n\n    output_font = options.output_font or makeOutputFileName(options.input_font)\n    log.info(\"Compiling features to '%s'\" % (output_font))\n\n    font = TTFont(options.input_font)\n    try:\n        addOpenTypeFeatures(\n            font, options.input_fea, tables=options.tables, debug=options.debug\n        )\n    except FeatureLibError as e:\n        if options.traceback:\n            raise\n        log.error(e)\n        sys.exit(1)\n    font.save(output_font)\n\n\nif __name__ == \"__main__\":\n    sys.exit(main())\n", "path": "Lib/fontTools/feaLib/__main__.py"}]}