improve error message for jnp.diagonal
```python
import jax.numpy as jnp
import numpy as np
M = jnp.ones(5)
```

Then, `np.diagonal(M)` returns a clear error message `ValueError: diag requires an array of at least two dimensions` whereas `jnp.diagonal(M)` returns a still-informative-but-less-clear `ValueError: axis 1 is out of bounds for array of dimension 1`.

Could we possibly change this behavior?
diff --git a/jax/_src/numpy/lax_numpy.py b/jax/_src/numpy/lax_numpy.py
index 1c63e3553..f477e4c17 100644
--- a/jax/_src/numpy/lax_numpy.py
+++ b/jax/_src/numpy/lax_numpy.py
@@ -2516,6 +2516,8 @@ def diag_indices_from(arr):
 def diagonal(a, offset=0, axis1: int = 0, axis2: int = 1):
   _check_arraylike("diagonal", a)
   a_shape = shape(a)
+  if ndim(a) < 2:
+    raise ValueError("diagonal requires an array of at least two dimensions.")
   offset = core.concrete_or_error(operator.index, offset, "'offset' argument of jnp.diagonal()")
 
   a = moveaxis(a, (axis1, axis2), (-2, -1))
['jax/_src/numpy/lax_numpy.py']