Either all code paths should have explicit returns, or none of them JS-0045
Anti-pattern
Minor
5 months ago3 years old
Async arrow function expected a return value
118
119  if (createError.isHttpError(err) && err.status < 500) {
120    res.status(err.status).json({ error: err.message })
121    return122  }
123  res.status(500).json({ error: 'Internal Server Error!' })
124}
Async arrow function expected a return value
112        return
113      default:
114        res.status(400).json({ error: 'Invalid form data!' })
115        return116    }
117  }
118
Async arrow function expected a return value
109            config.max_image_size_in_bytes / 1024 / 1024
110          } MB.`
111        })
112        return113      default:
114        res.status(400).json({ error: 'Invalid form data!' })
115        return
Async arrow function expected a return value
102        return
103      case 'LIMIT_FILE_COUNT':
104        res.status(400).json({ error: 'Too many files; limit is 1.' })
105        return106      case 'LIMIT_FILE_SIZE':
107        res.status(413).json({
108          error: `File too large; limit is ${
Async arrow function expected a return value
 99        res.status(400).json({
100          error: `Unexpected field name ${err.field}; field name must be 'file'.`
101        })
102        return103      case 'LIMIT_FILE_COUNT':
104        res.status(400).json({ error: 'Too many files; limit is 1.' })
105        return