Skip to content

Commit

Permalink
fbandroid/libraries/fresco/imagepipeline-base/src/main/java/com/faceb…
Browse files Browse the repository at this point in the history
…ook/cache/common/CacheErrorLogger.java

Reviewed By: steelrooter

Differential Revision: D54412935

fbshipit-source-id: 6e303a426b12515c8a8a70462e03245781c59aa4
  • Loading branch information
oprisnik authored and facebook-github-bot committed Jul 1, 2024
1 parent b718251 commit d34b71a
Showing 1 changed file with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,17 @@
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.cache.common;

import com.facebook.infer.annotation.Nullsafe;
import javax.annotation.Nullable;
package com.facebook.cache.common

/** An interface for logging various cache errors. */
@Nullsafe(Nullsafe.Mode.STRICT)
public interface CacheErrorLogger {
interface CacheErrorLogger {

/** A categorizaton of different cache and storage related errors. */
enum CacheErrorCategory {
enum class CacheErrorCategory {
READ_DECODE,
READ_FILE,
READ_FILE_NOT_FOUND,
READ_INVALID_ENTRY,

WRITE_ENCODE,
WRITE_CREATE_TEMPFILE,
WRITE_UPDATE_FILE_NOT_FOUND,
Expand All @@ -30,9 +25,7 @@ enum CacheErrorCategory {
WRITE_CREATE_DIR,
WRITE_CALLBACK_ERROR,
WRITE_INVALID_ENTRY,

DELETE_FILE,

EVICTION,
GENERIC_IO,
OTHER
Expand All @@ -46,6 +39,10 @@ enum CacheErrorCategory {
* @param message An optional error message
* @param throwable An optional exception
*/
void logError(
CacheErrorCategory category, Class<?> clazz, String message, @Nullable Throwable throwable);
fun logError(
category: CacheErrorCategory?,
clazz: Class<*>?,
message: String?,
throwable: Throwable?
)
}

0 comments on commit d34b71a

Please sign in to comment.