Skip to content

Commit

Permalink
chore: remove logRESTError (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored May 25, 2023
1 parent 42a054e commit fc781e7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 20 deletions.
2 changes: 0 additions & 2 deletions src/AutoThreads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
pipe,
seconds,
} from "bot/_common"
import { logRESTError } from "bot/utils/Errors"
import * as Str from "bot/utils/String"
import { Discord, DiscordREST, Ix, Log, Perms, UI } from "dfx"
import {
Expand Down Expand Up @@ -122,7 +121,6 @@ const make = ({ topicKeyword }: AutoThreadsOptions) =>
),
Effect.catchTags({
NotValidMessageError: () => Effect.unit(),
DiscordRESTError: logRESTError(log),
}),
Effect.catchAllCause(Effect.logErrorCause),
),
Expand Down
5 changes: 1 addition & 4 deletions src/Mentions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { ChannelsCache, ChannelsCacheLive } from "bot/ChannelsCache"
import { OpenAI, OpenAIMessage } from "bot/OpenAI"
import { Data, Effect, Layer, pipe } from "bot/_common"
import { logRESTError } from "bot/utils/Errors"
import * as Str from "bot/utils/String"
import { Discord, DiscordREST, Log } from "dfx"
import { Discord, DiscordREST } from "dfx"
import { DiscordGateway } from "dfx/DiscordGateway"

class NonEligibleMessage extends Data.TaggedClass("NonEligibleMessage")<{
Expand All @@ -15,7 +14,6 @@ const make = Effect.gen(function* (_) {
const gateway = yield* _(DiscordGateway)
const channels = yield* _(ChannelsCache)
const openai = yield* _(OpenAI)
const log = yield* _(Log.Log)

const botUser = yield* _(
rest.getCurrentUser(),
Expand Down Expand Up @@ -97,7 +95,6 @@ ${msg.content}`,
Effect.catchTags({
NonEligibleMessage: _ => Effect.unit(),
NoSuchElementException: _ => Effect.unit(),
DiscordRESTError: logRESTError(log),
}),
Effect.catchAllCause(Effect.logErrorCause),
),
Expand Down
5 changes: 1 addition & 4 deletions src/NoEmbed.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ChannelsCache, ChannelsCacheLive } from "bot/ChannelsCache"
import { Config, Data, Effect, Layer, pipe } from "bot/_common"
import { logRESTError } from "bot/utils/Errors"
import { Discord, DiscordREST, Log } from "dfx"
import { Discord, DiscordREST } from "dfx"
import { DiscordGateway } from "dfx/gateway"

class NotValidMessageError extends Data.TaggedClass("NotValidMessageError")<{
Expand All @@ -17,7 +16,6 @@ const make = ({ topicKeyword }: NoEmbedOptions) =>
const gateway = yield* _(DiscordGateway)
const rest = yield* _(DiscordREST)
const channels = yield* _(ChannelsCache)
const log = yield* _(Log.Log)

const getChannel = (guildId: string, id: string) =>
Effect.flatMap(channels.get(guildId, id), _ =>
Expand Down Expand Up @@ -58,7 +56,6 @@ const make = ({ topicKeyword }: NoEmbedOptions) =>
),
Effect.catchTags({
NotValidMessageError: () => Effect.unit(),
DiscordRESTError: logRESTError(log),
}),
Effect.catchAllCause(Effect.logErrorCause),
)
Expand Down
10 changes: 0 additions & 10 deletions src/utils/Errors.ts

This file was deleted.

0 comments on commit fc781e7

Please sign in to comment.