diff --git a/NEWS b/NEWS
index cc19a6be..8fe2294b 100644
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,8 @@ Changes from 0.13.0
    * Fixed a crash when `with` suppresses an exception. `with` now returns
      `None` in this case.
    * Fixed a crash when --repl-output-fn raises an exception
+   * Fixed a crash when HyTypeError was raised with objects that had no
+     source position
    * `assoc` now evaluates its arguments only once each
    * `break` and `continue` now raise an error when given arguments
      instead of silently ignoring them
diff --git a/hy/errors.py b/hy/errors.py
index 6fb00fdf..a1e04c50 100644
--- a/hy/errors.py
+++ b/hy/errors.py
@@ -43,41 +43,47 @@ class HyTypeError(TypeError):
 
     def __str__(self):
 
-        line = self.expression.start_line
-        start = self.expression.start_column
-        end = self.expression.end_column
-
-        source = []
-        if self.source is not None:
-            source = self.source.split("\n")[line-1:self.expression.end_line]
-
-            if line == self.expression.end_line:
-                length = end - start
-            else:
-                length = len(source[0]) - start
-
         result = ""
 
-        result += '  File "%s", line %d, column %d\n\n' % (self.filename,
-                                                           line,
-                                                           start)
-
-        if len(source) == 1:
-            result += '  %s\n' % colored.red(source[0])
-            result += '  %s%s\n' % (' '*(start-1),
-                                    colored.green('^' + '-'*(length-1) + '^'))
-        if len(source) > 1:
-            result += '  %s\n' % colored.red(source[0])
-            result += '  %s%s\n' % (' '*(start-1),
-                                    colored.green('^' + '-'*length))
-            if len(source) > 2:  # write the middle lines
-                for line in source[1:-1]:
-                    result += '  %s\n' % colored.red("".join(line))
-                    result += '  %s\n' % colored.green("-"*len(line))
-
-            # write the last line
-            result += '  %s\n' % colored.red("".join(source[-1]))
-            result += '  %s\n' % colored.green('-'*(end-1) + '^')
+        if all(getattr(self.expression, x, None) is not None
+               for x in ("start_line", "start_column", "end_column")):
+
+            line = self.expression.start_line
+            start = self.expression.start_column
+            end = self.expression.end_column
+
+            source = []
+            if self.source is not None:
+                source = self.source.split("\n")[line-1:self.expression.end_line]
+
+                if line == self.expression.end_line:
+                    length = end - start
+                else:
+                    length = len(source[0]) - start
+
+            result += '  File "%s", line %d, column %d\n\n' % (self.filename,
+                                                               line,
+                                                               start)
+
+            if len(source) == 1:
+                result += '  %s\n' % colored.red(source[0])
+                result += '  %s%s\n' % (' '*(start-1),
+                                        colored.green('^' + '-'*(length-1) + '^'))
+            if len(source) > 1:
+                result += '  %s\n' % colored.red(source[0])
+                result += '  %s%s\n' % (' '*(start-1),
+                                        colored.green('^' + '-'*length))
+                if len(source) > 2:  # write the middle lines
+                    for line in source[1:-1]:
+                        result += '  %s\n' % colored.red("".join(line))
+                        result += '  %s\n' % colored.green("-"*len(line))
+
+                # write the last line
+                result += '  %s\n' % colored.red("".join(source[-1]))
+                result += '  %s\n' % colored.green('-'*(end-1) + '^')
+
+        else:
+            result += '  File "%s", unknown location\n' % self.filename
 
         result += colored.yellow("%s: %s\n\n" %
                                  (self.__class__.__name__,

repl shouldn't crash
```Hy
=> (defmacro bad [] `(macro-error 'x ""))
<function <lambda> at 0x000001D01D0ED7B8>
=> (bad)
Traceback (most recent call last):
  File "c:\users\me\documents\github\hy\hy\cmdline.py", line 99, in runsource
    ast_callback)
  File "c:\users\me\documents\github\hy\hy\importer.py", line 198, in hy_eval
    eval(ast_compile(_ast, "<eval_body>", "exec"), namespace)
  File "<eval_body>", line 1, in <module>
hy.errors.HyMacroExpansionError: <exception str() failed>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\ME\workspace\hy36-gilch\Scripts\hy-script.py", line 11, in <module>
    load_entry_point('hy', 'console_scripts', 'hy')()
  File "c:\users\me\documents\github\hy\hy\cmdline.py", line 346, in hy_main
    sys.exit(cmdline_handler("hy", sys.argv))
  File "c:\users\me\documents\github\hy\hy\cmdline.py", line 341, in cmdline_handler
    return run_repl(spy=options.spy, output_fn=options.repl_output_fn)
  File "c:\users\me\documents\github\hy\hy\cmdline.py", line 236, in run_repl
    os=platform.system()
  File "C:\Users\ME\AppData\Local\Programs\Python\Python36\lib\code.py", line 233, in interact
    more = self.push(line)
  File "C:\Users\ME\AppData\Local\Programs\Python\Python36\lib\code.py", line 259, in push
    more = self.runsource(source, self.filename)
  File "c:\users\me\documents\github\hy\hy\cmdline.py", line 105, in runsource
    print(e, file=sys.stderr)
  File "c:\users\me\documents\github\hy\hy\errors.py", line 46, in __str__
    line = self.expression.start_line
AttributeError: 'HySymbol' object has no attribute 'start_line'
```
The repl should report errors, but not exit.
diff --git a/tests/test_bin.py b/tests/test_bin.py
index ad2ea132..0b2a0ad5 100644
--- a/tests/test_bin.py
+++ b/tests/test_bin.py
@@ -138,6 +138,16 @@ def test_bin_hy_stdin_except_do():
     assert "zzz" in output
 
 
+def test_bin_hy_stdin_unlocatable_hytypeerror():
+    # https://github.com/hylang/hy/issues/1412
+    # The chief test of interest here is the returncode assertion
+    # inside run_cmd.
+    _, err = run_cmd("hy", """
+        (import hy.errors)
+        (raise (hy.errors.HyTypeError '[] (+ "A" "Z")))""")
+    assert "AZ" in err
+
+
 def test_bin_hy_stdin_bad_repr():
     # https://github.com/hylang/hy/issues/1389
     output, err = run_cmd("hy", """

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest flake8 tox Pygments Sphinx sphinx_rtd_theme
apt-get update apt-get install -y gcc
3.6
requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
appdirs==1.4.4
args==0.1.0
astor==0.8.1
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
clint==0.5.1
coverage==6.2
distlib==0.3.9
docutils==0.17.1
filelock==3.4.1
flake8==5.0.4
-e git+https://github.com/hylang/hy.git@db210929d0d74d38232eef1a3cfaf81fc6508087#egg=hy
idna==3.10
imagesize==1.4.1
importlib-metadata==4.2.0
importlib-resources==5.4.0
iniconfig==1.1.1
Jinja2==3.0.3
MarkupSafe==2.0.1
mccabe==0.7.0
packaging==21.3
platformdirs==2.4.0
pluggy==1.0.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytz==2025.2
requests==2.27.1
rply==0.7.8
six==1.17.0
snowballstemmer==2.2.0
Sphinx==4.3.2
sphinx-rtd-theme==1.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
toml==0.10.2
tomli==1.2.3
tox==3.28.0
typing_extensions==4.1.1
urllib3==1.26.20
virtualenv==20.16.2
zipp==3.6.0

name: hy
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - appdirs==1.4.4
      - args==0.1.0
      - astor==0.8.1
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - clint==0.5.1
      - coverage==6.2
      - distlib==0.3.9
      - docutils==0.17.1
      - filelock==3.4.1
      - flake8==5.0.4
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.2.0
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - mccabe==0.7.0
      - packaging==21.3
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytz==2025.2
      - requests==2.27.1
      - rply==0.7.8
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==4.3.2
      - sphinx-rtd-theme==1.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - toml==0.10.2
      - tomli==1.2.3
      - tox==3.28.0
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - virtualenv==20.16.2
      - zipp==3.6.0
prefix: /opt/conda/envs/hy

tests/test_bin.py::test_bin_hy_stdin_unlocatable_hytypeerror
tests/test_bin.py::test_bin_hy_stdin tests/test_bin.py::test_bin_hy_icmd_and_spy
tests/test_bin.py::test_bin_hy tests/test_bin.py::test_bin_hy_stdin_multiline tests/test_bin.py::test_bin_hy_stdin_comments tests/test_bin.py::test_bin_hy_stdin_assignment tests/test_bin.py::test_bin_hy_stdin_as_arrow tests/test_bin.py::test_bin_hy_stdin_error_underline_alignment tests/test_bin.py::test_bin_hy_stdin_except_do tests/test_bin.py::test_bin_hy_stdin_bad_repr tests/test_bin.py::test_bin_hy_stdin_hy_repr tests/test_bin.py::test_bin_hy_cmd tests/test_bin.py::test_bin_hy_icmd tests/test_bin.py::test_bin_hy_icmd_file tests/test_bin.py::test_bin_hy_missing_file tests/test_bin.py::test_bin_hy_file_with_args tests/test_bin.py::test_bin_hyc tests/test_bin.py::test_bin_hyc_missing_file tests/test_bin.py::test_hy2py tests/test_bin.py::test_bin_hy_builtins tests/test_bin.py::test_bin_hy_main tests/test_bin.py::test_bin_hy_main_args tests/test_bin.py::test_bin_hy_main_exitvalue tests/test_bin.py::test_bin_hy_no_main tests/test_bin.py::test_bin_hy_byte_compile[hy tests/test_bin.py::test_bin_hy_module_main tests/test_bin.py::test_bin_hy_module_main_args tests/test_bin.py::test_bin_hy_module_main_exitvalue tests/test_bin.py::test_bin_hy_module_no_main
NEWS hy/errors.py
NEWS hy/errors.py