# ClientProfile

`com.jsmacrosce.jsmacros.client.config.ClientProfile`

Client-side profile implementation with client event, library, and helper registrations and client-specific error reporting.  
 Scripts can access the active profile through the client core:  
 ```js
const Client = Java.type('com.jsmacrosce.jsmacros.client.JsMacrosClient');  
const profile = Client.clientCore.profile;  
Chat.log(profile.getCurrentProfileName());  
 ```

## Constructors

### new ClientProfile {#com.jsmacrosce.jsmacros.client.config.ClientProfile_constructor-Core-Logger-}

```js
new ClientProfile(Core<ClientProfile, ?> runner, Logger logger)
```

Stores the supplied core and logger through the base profile; registry setup and profile loading are not performed here.

**Parameters:**
- `runner`: client core associated with this profile
- `logger`: logger for diagnostics

## Fields

### ignoredErrors {#com.jsmacrosce.jsmacros.client.config.ClientProfile_ignoredErrors}

```js
static ignoredErrors: Class<? extends Throwable>[]
```

Mutable exception classes suppressed from chat error reporting; matching includes subclasses. Stack traces are still printed first.  
 Defaults to `InterruptedException` and `BaseScriptContext.ScriptAssertionError`.

## Methods

### checkJoinedThreadStack {#com.jsmacrosce.jsmacros.client.config.ClientProfile_checkJoinedThreadStack-}

```js
checkJoinedThreadStack(): boolean
```

Checks whether the current thread is Minecraft's thread or is present in this profile's joined-thread set.

**Returns:** `true` on the Minecraft thread or when the current thread is in the joined-thread set

### initRegistries {#com.jsmacrosce.jsmacros.client.config.ClientProfile_initRegistries-}

```js
initRegistries(): void
```

Initializes base registries, then registers client events, libraries, and helper mappings. Called during profile initialization; not intended for script invocation.

### logError {#com.jsmacrosce.jsmacros.client.config.ClientProfile_logError-Throwable-}

```js
logError(Throwable ex): void
```

Prints the failure's stack trace, then attempts to queue a chat report when a GUI is available unless its class or a runtime exception's direct cause matches `ignoredErrors`. A runtime exception is unwrapped when its message equals its cause's string form. If neither ignore check suppresses it and the runtime exception has a non-null cause but a null message, the comparison can throw `NullPointerException`. Chat reporting is queued and is not guaranteed to display successfully.

**Parameters:**
- `ex`: non-null failure to report
