stash/pkg/api
SmallCoccinelle 87709fd018
Errcheck phase 1 (#1715)
* Avoid redundant logging in migrations

Return the error and let the caller handle the logging of the error if
needed.

While here, defer m.Close() to the function boundary.

* Treat errors as values

Use %v rather than %s and pass the errors directly.

* Generate a wrapped error on stat-failure

* Log 3 unchecked errors

Rather than ignore errors, log them at
the WARNING log level.

The server has been functioning without these, so assume they are not at
the ERROR level.

* Propagate errors upward

Failure in path generation was ignored. Propagate the errors upward the
call stack, so it can be handled at the level of orchestration.

* Warn on errors

Log errors rather than quenching them.

Errors are logged at the Warn-level for now.

* Check error when creating test databases

Use the builtin log package and stop the program fatally on error.

* Add warnings to uncheck task errors

Focus on the task system in a single commit, logging unchecked
errors as warnings.

* Warn-on-error in API routes

Look through the API routes, and make sure errors are being logged if
they occur. Prefer the Warn-log-level because none of these has proven
to be fatal in the system up until now.

* Propagate error when adding Util API

* Propagate error on adding util API

* Return unhandled error

* JS log API: propagate and log errors

* JS Plugins: log GQL addition failures.

* Warn on failure to write to stdin

* Warn on failure to stop task

* Wrap viper.BindEnv

The current viper code only errors if no name is provided, so it should
never fail. Rewrite the code flow to factor through a panic-function.

This removes error warnings from this part of the code.

* Log errors in concurrency test

If we can't initialize the configuration, treat the test as a failure.

* Warn on errors in configuration code

* Plug an unchecked error in gallery zip walking

* Warn on screenshot serving failure

* Warn on encoder screenshot failure

* Warn on errors in path-handling code

* Undo the errcheck on configurations for now.

* Use one-line initializers where applicable

rather than using

  err := f()
  if err!= nil { ..

prefer the shorter

  if err := f(); err != nil { ..

If f() isn't too long of a name, or wraps a function with a body.
2021-09-21 09:34:25 +10:00
..
urlbuilders Generate screenshot images for markers (#1604) 2021-09-15 12:27:05 +10:00
changeset_translator.go Remove assignments to _ (#1685) 2021-09-07 13:18:32 +10:00
check_version.go Apple Silicon Support, Bump Go to 1.17, refactor docker/build/x86_64/Dockerfile (#1646) 2021-09-08 15:30:15 +10:00
context_keys.go Remove unused (#1709) 2021-09-09 14:10:08 +10:00
images.go Changes to Default Performer Images (for Accessibility) (#1489) 2021-08-10 13:51:31 +10:00
resolver.go Unify scrape refactor (#1630) 2021-09-07 11:54:22 +10:00
resolver_model_gallery.go Add CreatedAt & UpdatedAt to all object resolvers (#1421) 2021-05-25 10:56:34 +10:00
resolver_model_image.go Add CreatedAt & UpdatedAt to all object resolvers (#1421) 2021-05-25 10:56:34 +10:00
resolver_model_movie.go Add CreatedAt & UpdatedAt to all object resolvers (#1421) 2021-05-25 10:56:34 +10:00
resolver_model_performer.go Add CreatedAt & UpdatedAt to all object resolvers (#1421) 2021-05-25 10:56:34 +10:00
resolver_model_scene.go Fix inf values causing marshal error (#1607) 2021-08-03 14:29:57 +10:00
resolver_model_scene_marker.go Generate screenshot images for markers (#1604) 2021-09-15 12:27:05 +10:00
resolver_model_studio.go Studio aliases (#1660) 2021-09-09 18:13:42 +10:00
resolver_model_tag.go Tag hierarchy (#1519) 2021-09-09 14:58:43 +10:00
resolver_mutation_configure.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
resolver_mutation_dlna.go DLNA (#1364) 2021-05-20 16:58:43 +10:00
resolver_mutation_gallery.go Plugin hooks (#1452) 2021-06-11 17:24:58 +10:00
resolver_mutation_image.go Plugin hooks (#1452) 2021-06-11 17:24:58 +10:00
resolver_mutation_job.go Job queueing (#1379) 2021-05-24 14:24:18 +10:00
resolver_mutation_metadata.go Plugin hooks (#1452) 2021-06-11 17:24:58 +10:00
resolver_mutation_movie.go Plugin hooks (#1452) 2021-06-11 17:24:58 +10:00
resolver_mutation_performer.go Plugin hooks (#1452) 2021-06-11 17:24:58 +10:00
resolver_mutation_plugin.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
resolver_mutation_saved_filter.go Saved filters (#1474) 2021-06-16 14:53:32 +10:00
resolver_mutation_scene.go Add Movie option to Scene bulk edit (#1676) 2021-09-07 12:44:18 +10:00
resolver_mutation_scraper.go Refactor xpath scraper code. Add fixed and map (#616) 2020-07-21 14:06:25 +10:00
resolver_mutation_stash_box.go Plugin hooks (#1452) 2021-06-11 17:24:58 +10:00
resolver_mutation_studio.go Studio aliases (#1660) 2021-09-09 18:13:42 +10:00
resolver_mutation_tag.go Tag hierarchy (#1519) 2021-09-09 14:58:43 +10:00
resolver_mutation_tag_test.go Plugin hooks (#1452) 2021-06-11 17:24:58 +10:00
resolver_query_configuration.go Add script offset / delay to Handy support. (#1573) 2021-08-26 11:50:02 +10:00
resolver_query_dlna.go DLNA (#1364) 2021-05-20 16:58:43 +10:00
resolver_query_find_gallery.go Data layer restructuring (#997) 2021-01-18 12:23:20 +11:00
resolver_query_find_image.go Fix: unhandled errors (#1419) 2021-05-25 18:40:51 +10:00
resolver_query_find_movie.go Remove slim graphql endpoints (#1207) 2021-03-17 11:17:01 +11:00
resolver_query_find_performer.go Remove slim graphql endpoints (#1207) 2021-03-17 11:17:01 +11:00
resolver_query_find_saved_filter.go Saved filters (#1474) 2021-06-16 14:53:32 +10:00
resolver_query_find_scene.go Fix: unhandled errors (#1419) 2021-05-25 18:40:51 +10:00
resolver_query_find_scene_marker.go Data layer restructuring (#997) 2021-01-18 12:23:20 +11:00
resolver_query_find_studio.go Remove slim graphql endpoints (#1207) 2021-03-17 11:17:01 +11:00
resolver_query_find_tag.go Remove slim graphql endpoints (#1207) 2021-03-17 11:17:01 +11:00
resolver_query_job.go Job queueing (#1379) 2021-05-24 14:24:18 +10:00
resolver_query_logs.go Change thumbnail default size and resize algorithm (#336) 2020-01-31 17:19:15 -05:00
resolver_query_metadata.go Job queueing (#1379) 2021-05-24 14:24:18 +10:00
resolver_query_plugin.go Add plugin tasks (#651) 2020-08-08 12:05:35 +10:00
resolver_query_scene.go Setup and migration UI refactor (#1190) 2021-04-12 09:31:33 +10:00
resolver_query_scraper.go Scrape scene by name (#1712) 2021-09-14 14:54:53 +10:00
resolver_subscription_job.go Remove unused (#1709) 2021-09-09 14:10:08 +10:00
resolver_subscription_logging.go Add logs to Logs page (#151) 2019-10-24 19:07:07 -04:00
routes_downloads.go Selective export (#770) 2020-09-15 17:28:53 +10:00
routes_image.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
routes_movie.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
routes_performer.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
routes_scene.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
routes_studio.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
routes_tag.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
server.go Remove unused (#1709) 2021-09-09 14:10:08 +10:00
session.go Remove unused (#1709) 2021-09-09 14:10:08 +10:00
types.go Fix inf values causing marshal error (#1607) 2021-08-03 14:29:57 +10:00